|
@@ -12,10 +12,21 @@
|
|
|
//!
|
|
//!
|
|
|
//! Converts between a string (such as an URL’s query string)
|
|
//! Converts between a string (such as an URL’s query string)
|
|
|
//! and a sequence of (name, value) pairs.
|
|
//! and a sequence of (name, value) pairs.
|
|
|
|
|
+#![no_std]
|
|
|
|
|
|
|
|
|
|
+// For forwards compatibility
|
|
|
|
|
+#[cfg(feature = "std")]
|
|
|
|
|
+extern crate std as _;
|
|
|
|
|
+
|
|
|
|
|
+extern crate alloc;
|
|
|
|
|
+
|
|
|
|
|
+#[cfg(not(feature = "alloc"))]
|
|
|
|
|
+compile_error!("the `alloc` feature must currently be enabled");
|
|
|
|
|
+
|
|
|
|
|
+use alloc::borrow::{Borrow, Cow, ToOwned};
|
|
|
|
|
+use alloc::string::String;
|
|
|
|
|
+use core::str;
|
|
|
use percent_encoding::{percent_decode, percent_encode_byte};
|
|
use percent_encoding::{percent_decode, percent_encode_byte};
|
|
|
-use std::borrow::{Borrow, Cow};
|
|
|
|
|
-use std::str;
|
|
|
|
|
|
|
|
|
|
/// Convert a byte string in the `application/x-www-form-urlencoded` syntax
|
|
/// Convert a byte string in the `application/x-www-form-urlencoded` syntax
|
|
|
/// into a iterator of (name, value) pairs.
|
|
/// into a iterator of (name, value) pairs.
|