-
Notifications
You must be signed in to change notification settings - Fork 346
Use collections from the alloc crate in percent_encoding #691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some downstream users might not have alloc available, right? I think this makes their lives worse? |
Fair enough. Added all the usage of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Could you, please, publish a version with this PR? I need it for a project. |
Technically speaking, this is a breaking change if a downstream user specifies |
I wouldn't be surprised if there are people using default-features = false anyway out of habit. |
I've done a quick search for packages in rust-lang/crates.io-index whose most recently published version has dependency on $ curl -fL -o crates.io-index.zip https://github.com/rust-lang/crates.io-index/archive/refs/heads/master.zip
$ stat -f '%Sm' -t '%FT%T%z' crates.io-index.zip
2021-12-08T17:43:38+0900
$ unzip crates.io-index.zip
$ find crates.io-index-master -type f ! -name config.json | xargs -n 253 tail -q -n 1 | jq -c 'select(.deps | any([.name == "percent-encoding", .default_features == false] | all)) | {name, vers}' Result: {"name":"instagram-web-api","vers":"0.1.1"}
{"name":"twilight-lavalink","vers":"0.8.0"}
{"name":"twilight-http","vers":"0.8.0"}
{"name":"mendes","vers":"0.0.60"}
{"name":"atlassian-app-auth","vers":"1.0.1"}
{"name":"gcs-rsync","vers":"0.1.10"}
{"name":"cloud-storage-rs","vers":"0.4.3"}
{"name":"cloud-storage","vers":"0.11.0-rc.1"} So there are indeed downstream crates with I didn't build them with this change applied so I don't know if this breaks the above crates (I'm too nervous to build random packages in an unsandboxed environment and too lazy to set up a Crater-like sandboxed environment or manually review each package). |
Full `no_std` support is pending the release of <servo/rust-url#691>.
Use collections from
alloc
in thepercent_encoding
crate, thus making it fullyno_std
compatible.Additionally implementsFrom<PercendEncode>>
andFrom<PercendDecode>>
forbeef::Cow
, using an optionalbeef
feature gate.Edit: ditched the beef implementation as it didn't pass all of the checks.