File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ impl Idna {
453453 return Errors :: default ( ) ;
454454 }
455455 let mut errors = processing ( domain, self . config , & mut self . normalized , out) ;
456- self . output = std :: mem:: replace ( out, String :: with_capacity ( out. len ( ) ) ) ;
456+ self . output = core :: mem:: replace ( out, String :: with_capacity ( out. len ( ) ) ) ;
457457 let mut first = true ;
458458 for label in self . output . split ( '.' ) {
459459 if !first {
Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ debugger_test = "0.1"
2828debugger_test_parser = " 0.1"
2929
3030[dependencies ]
31- form_urlencoded = { version = " 1.1.0" , path = " ../form_urlencoded" }
32- idna = { version = " 0.3.0" , path = " ../idna" }
33- percent-encoding = { version = " 2.2.0" , path = " ../percent_encoding" }
31+ form_urlencoded = { version = " 1.1.0" , path = " ../form_urlencoded" , default-features = false }
32+ idna = { version = " 0.3.0" , path = " ../idna" , default-features = false }
33+ percent-encoding = { version = " 2.2.0" , path = " ../percent_encoding" , default-features = false }
3434serde = {version = " 1.0" , optional = true , features = [" derive" ]}
3535
3636[features ]
3737default = [" std" ]
38- std = [" idna/std" , " alloc" ]
38+ std = [" idna/std" , " percent-encoding/std " , " form_urlencoded/std " , " alloc" ]
3939alloc = []
4040# UNSTABLE FEATURES (requires Rust nightly)
4141# Enable to use the #[debugger_visualizer] attribute.
Original file line number Diff line number Diff line change @@ -11,10 +11,13 @@ use alloc::{
1111 string:: { String , ToString } ,
1212 vec:: Vec ,
1313} ;
14+ #[ cfg( not( feature = "std" ) ) ]
15+ use core:: net:: { Ipv4Addr , Ipv6Addr } ;
1416use core:: {
1517 cmp,
1618 fmt:: { self , Formatter } ,
1719} ;
20+ #[ cfg( feature = "std" ) ]
1821use std:: net:: { Ipv4Addr , Ipv6Addr } ;
1922
2023use percent_encoding:: { percent_decode, utf8_percent_encode, CONTROLS } ;
Original file line number Diff line number Diff line change @@ -127,13 +127,16 @@ url = { version = "2", features = ["serde"] }
127127 feature( debugger_visualizer) ,
128128 debugger_visualizer( natvis_file = "../../debug_metadata/url.natvis" )
129129) ]
130+ #![ no_std]
131+ #![ cfg_attr( not( feature = "std" ) , feature( ip_in_core) ) ]
130132
131133pub use form_urlencoded;
132134
133135// For forwards compatibility
134136#[ cfg( feature = "std" ) ]
135137extern crate std;
136138
139+ #[ macro_use]
137140extern crate alloc;
138141
139142#[ cfg( not( feature = "alloc" ) ) ]
@@ -152,9 +155,12 @@ use core::convert::TryFrom;
152155use core:: fmt:: { self , Write } ;
153156use core:: hash;
154157use core:: mem;
158+ #[ cfg( not( feature = "std" ) ) ]
159+ use core:: net:: IpAddr ;
155160use core:: ops:: { Range , RangeFrom , RangeTo } ;
156161use core:: str;
157162use percent_encoding:: utf8_percent_encode;
163+ #[ cfg( feature = "std" ) ]
158164use std:: net:: IpAddr ;
159165#[ cfg( feature = "std" ) ]
160166use std:: {
You can’t perform that action at this time.
0 commit comments