-
Notifications
You must be signed in to change notification settings - Fork 326
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
no_std
support for the url
crate
#831
base: main
Are you sure you want to change the base?
Changes from 36 commits
35653b0
194122c
422a260
81ee074
67d2a4c
db92dd2
bb7955a
a98aef8
0d14d5a
315eb43
6d622ab
3efe254
36bc5b3
29bfcf7
e16eb2b
3dd87d8
af1d5d5
b908f7f
fd98554
b0bb942
047d334
028424a
7073957
be123af
c145584
be73851
96e2a04
268c17e
0c02cd9
316c868
43c7d41
74c0910
a544730
619de8e
00efb8f
fc0778f
027e1c7
d367346
7377a57
d43506b
c8d8e6d
3bf9eac
a73e755
a4422a9
93c4871
c79a0d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/url" | |
repository = "https://github.com/servo/rust-url" | ||
readme = "../README.md" | ||
keywords = ["url", "parser"] | ||
categories = ["parser-implementations", "web-programming", "encoding"] | ||
categories = ["parser-implementations", "web-programming", "encoding", "no_std"] | ||
license = "MIT OR Apache-2.0" | ||
include = ["src/**/*", "LICENSE-*", "README.md", "tests/**"] | ||
edition = "2018" | ||
|
@@ -25,17 +25,26 @@ bencher = "0.1" | |
wasm-bindgen-test = "0.3" | ||
|
||
[dependencies] | ||
form_urlencoded = { version = "1.2.1", path = "../form_urlencoded" } | ||
idna = { version = "0.5.0", path = "../idna" } | ||
percent-encoding = { version = "2.3.1", path = "../percent_encoding" } | ||
serde = { version = "1.0", optional = true, features = ["derive"] } | ||
form_urlencoded = { version = "1.2.1", path = "../form_urlencoded", default-features = false, features = ["alloc"] } | ||
idna = { version = "0.5.0", path = "../idna", default-features = false, features = ["alloc"] } | ||
percent-encoding = { version = "2.3.1", path = "../percent_encoding", default-features = false, features = ["alloc"] } | ||
serde = {version = "1.0", optional = true, features = ["derive"]} | ||
no-std-net = { version = "0.6.0", default-features = false, optional = true } | ||
|
||
[features] | ||
default = [] | ||
default = ["std"] | ||
std = ["idna/std", "percent-encoding/std", "form_urlencoded/std", "alloc"] | ||
alloc = ["form_urlencoded/alloc", "idna/alloc", "percent-encoding/alloc"] | ||
|
||
# Enable to use the #[debugger_visualizer] attribute. This feature requires Rust >= 1.71. | ||
debugger_visualizer = [] | ||
# Expose internal offsets of the URL. | ||
expose_internals = [] | ||
# For no_std: Allow the use of no_std_net instead of nightly | ||
no_std_net = ["no-std-net"] | ||
# UNSTABLE FEATURES (requires Rust nightly) | ||
# For no_std: Use errors_in_core and net_in_core | ||
unstable = ["idna/unstable"] | ||
domenukk marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rust-lang/rust#108443 is FCP-ing now, so it'll probably land in a few months - perhaps we should wait with this feature until then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now this PR also uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value in that feature is that this could become a non-breaking change (other than bumping MSRV, which is probably acceptable). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update: |
||
|
||
[[test]] | ||
name = "url_wpt" | ||
|
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.
I fear this might be a fairly big breaking change?
When I added
no_std
support for the other libraries in this crate, it was more trivial, since there was only three crates that disabled default features - but that is not the case forurl
; there are many crates specifyingdefault-features = false
, so even though there was no default features previously, this change will affect all of those crates.Python script for finding crates using `default-features = false`.
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.
I don't see any other way?
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.
Well... I see two:
url v0.3
unstable-no-std
instead, to signify that it may break other crates in the dependency chain, and that it is a bad way of doing it which will be rectified oncev0.3
is released.