File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name = "form_urlencoded"
33version = " 1.1.0"
44authors = [" The rust-url developers" ]
55description = " Parser and serializer for the application/x-www-form-urlencoded syntax, as used by HTML forms."
6+ categories = [" no_std" ]
67repository = " https://github.com/servo/rust-url"
78license = " MIT OR Apache-2.0"
89edition = " 2018"
@@ -11,5 +12,10 @@ rust-version = "1.51"
1112[lib ]
1213test = false
1314
15+ [features ]
16+ default = [" std" ]
17+ std = [" alloc" , " percent-encoding/std" ]
18+ alloc = [" percent-encoding/alloc" ]
19+
1420[dependencies ]
15- percent-encoding = { version = " 2.2.0" , path = " ../percent_encoding" }
21+ percent-encoding = { version = " 2.2.0" , default-features = false , path = " ../percent_encoding" }
Original file line number Diff line number Diff line change 1212//!
1313//! Converts between a string (such as an URL’s query string)
1414//! and a sequence of (name, value) pairs.
15+ #![ no_std]
1516
17+ // For forwards compatibility
18+ #[ cfg( feature = "std" ) ]
19+ extern crate std as _;
20+
21+ extern crate alloc;
22+
23+ #[ cfg( not( feature = "alloc" ) ) ]
24+ compile_error ! ( "the `alloc` feature must currently be enabled" ) ;
25+
26+ use alloc:: borrow:: { Borrow , Cow , ToOwned } ;
27+ use alloc:: string:: String ;
28+ use core:: str;
1629use percent_encoding:: { percent_decode, percent_encode_byte} ;
17- use std:: borrow:: { Borrow , Cow } ;
18- use std:: str;
1930
2031/// Convert a byte string in the `application/x-www-form-urlencoded` syntax
2132/// into a iterator of (name, value) pairs.
You can’t perform that action at this time.
0 commit comments