servo / rust-url

URL parser for Rust
https://docs.rs/url/
Apache License 2.0
1.27k stars 318 forks source link

empty string when `password` does not exists #804

Open raccmonteiro opened 1 year ago

raccmonteiro commented 1 year ago

Accordingly to standard (https://url.spec.whatwg.org/#url-representation) when the url does not have a password we should get an empty string: "A URL’s password is an ASCII string identifying a password. It is initially the empty string."

So, this changes password function from password(&self) -> Option<&str> to password(&self) -> &str

Closes #793