Add std feature to percent_encoding

For future compatibility
This commit is contained in:
Mads Marquart 2023-02-21 05:13:20 +01:00
parent edeaea7f1e
commit 964fb73ebf
2 changed files with 8 additions and 2 deletions

View file

@ -3,11 +3,13 @@ name = "percent-encoding"
version = "2.2.0"
authors = ["The rust-url developers"]
description = "Percent encoding and decoding"
categories = ["no_std"]
repository = "https://github.com/servo/rust-url/"
license = "MIT OR Apache-2.0"
edition = "2018"
rust-version = "1.51"
[features]
default = ["alloc"]
default = ["std"]
std = ["alloc"]
alloc = []

View file

@ -36,8 +36,12 @@
//!
//! assert_eq!(utf8_percent_encode("foo <bar>", FRAGMENT).to_string(), "foo%20%3Cbar%3E");
//! ```
#![no_std]
// For forwards compatibility
#[cfg(feature = "std")]
extern crate std as _;
#[cfg(feature = "alloc")]
extern crate alloc;