Skip to content

Commit 4b12c9b

Browse files
committed
make compile with no_std
1 parent 18640a0 commit 4b12c9b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

url/src/host.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn domain_to_ascii(domain: Cow<'_, [u8]>) -> Result<Cow<'_, str>, ParseError> {
176176
Ok(match value {
177177
Cow::Owned(value) => Cow::Owned(value),
178178
Cow::Borrowed(_) => match domain {
179-
Cow::Borrowed(value) => unsafe { Cow::Borrowed(std::str::from_utf8_unchecked(value)) },
179+
Cow::Borrowed(value) => unsafe { Cow::Borrowed(core::str::from_utf8_unchecked(value)) },
180180
Cow::Owned(value) => unsafe { String::from_utf8_unchecked(value).into() },
181181
},
182182
})

url/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ use crate::net::IpAddr;
175175
use crate::net::{SocketAddr, ToSocketAddrs};
176176
use crate::parser::{to_u32, Context, Parser, SchemeType, USERINFO};
177177
use alloc::borrow::ToOwned;
178+
use alloc::borrow::Cow;
178179
use alloc::str;
179180
use alloc::string::{String, ToString};
180181
use core::borrow::Borrow;
@@ -183,7 +184,6 @@ use core::fmt::Write;
183184
use core::ops::{Range, RangeFrom, RangeTo};
184185
use core::{cmp, fmt, hash, mem};
185186
use percent_encoding::utf8_percent_encode;
186-
use std::borrow::Cow;
187187
#[cfg(feature = "std")]
188188
#[cfg(any(
189189
unix,

url/src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use alloc::string::String;
1010
use core::fmt::{self, Formatter, Write};
1111
use core::str;
12-
use std::borrow::Cow;
12+
use alloc::borrow::Cow;
1313

1414
use crate::host::{Host, HostInternal};
1515
use crate::Url;

0 commit comments

Comments
 (0)