File tree 2 files changed +19
-2
lines changed 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name = "form_urlencoded"
3
3
version = " 1.1.0"
4
4
authors = [" The rust-url developers" ]
5
5
description = " Parser and serializer for the application/x-www-form-urlencoded syntax, as used by HTML forms."
6
+ categories = [" no_std" ]
6
7
repository = " https://github.com/servo/rust-url"
7
8
license = " MIT OR Apache-2.0"
8
9
edition = " 2018"
@@ -11,5 +12,10 @@ rust-version = "1.51"
11
12
[lib ]
12
13
test = false
13
14
15
+ [features ]
16
+ default = [" std" ]
17
+ std = [" alloc" ]
18
+ alloc = []
19
+
14
20
[dependencies ]
15
21
percent-encoding = { version = " 2.2.0" , path = " ../percent_encoding" }
Original file line number Diff line number Diff line change 12
12
//!
13
13
//! Converts between a string (such as an URL’s query string)
14
14
//! and a sequence of (name, value) pairs.
15
+ #![ no_std]
15
16
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;
16
29
use percent_encoding:: { percent_decode, percent_encode_byte} ;
17
- use std:: borrow:: { Borrow , Cow } ;
18
- use std:: str;
19
30
20
31
/// Convert a byte string in the `application/x-www-form-urlencoded` syntax
21
32
/// into a iterator of (name, value) pairs.
You can’t perform that action at this time.
0 commit comments