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 {
453
453
return Errors :: default ( ) ;
454
454
}
455
455
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 ( ) ) ) ;
457
457
let mut first = true ;
458
458
for label in self . output . split ( '.' ) {
459
459
if !first {
Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ debugger_test = "0.1"
28
28
debugger_test_parser = " 0.1"
29
29
30
30
[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 }
34
34
serde = {version = " 1.0" , optional = true , features = [" derive" ]}
35
35
36
36
[features ]
37
37
default = [" std" ]
38
- std = [" idna/std" , " alloc" ]
38
+ std = [" idna/std" , " percent-encoding/std " , " form_urlencoded/std " , " alloc" ]
39
39
alloc = []
40
40
# UNSTABLE FEATURES (requires Rust nightly)
41
41
# Enable to use the #[debugger_visualizer] attribute.
Original file line number Diff line number Diff line change @@ -11,10 +11,13 @@ use alloc::{
11
11
string:: { String , ToString } ,
12
12
vec:: Vec ,
13
13
} ;
14
+ #[ cfg( not( feature = "std" ) ) ]
15
+ use core:: net:: { Ipv4Addr , Ipv6Addr } ;
14
16
use core:: {
15
17
cmp,
16
18
fmt:: { self , Formatter } ,
17
19
} ;
20
+ #[ cfg( feature = "std" ) ]
18
21
use std:: net:: { Ipv4Addr , Ipv6Addr } ;
19
22
20
23
use 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"] }
127
127
feature( debugger_visualizer) ,
128
128
debugger_visualizer( natvis_file = "../../debug_metadata/url.natvis" )
129
129
) ]
130
+ #![ no_std]
131
+ #![ cfg_attr( not( feature = "std" ) , feature( ip_in_core) ) ]
130
132
131
133
pub use form_urlencoded;
132
134
133
135
// For forwards compatibility
134
136
#[ cfg( feature = "std" ) ]
135
137
extern crate std;
136
138
139
+ #[ macro_use]
137
140
extern crate alloc;
138
141
139
142
#[ cfg( not( feature = "alloc" ) ) ]
@@ -152,9 +155,12 @@ use core::convert::TryFrom;
152
155
use core:: fmt:: { self , Write } ;
153
156
use core:: hash;
154
157
use core:: mem;
158
+ #[ cfg( not( feature = "std" ) ) ]
159
+ use core:: net:: IpAddr ;
155
160
use core:: ops:: { Range , RangeFrom , RangeTo } ;
156
161
use core:: str;
157
162
use percent_encoding:: utf8_percent_encode;
163
+ #[ cfg( feature = "std" ) ]
158
164
use std:: net:: IpAddr ;
159
165
#[ cfg( feature = "std" ) ]
160
166
use std:: {
You can’t perform that action at this time.
0 commit comments