Age | Commit message (Collapse) | Author |
|
Previously
Uri::parse("foo").unwrap().resolve(&Uri::parse("bar").unwrap()).to_string()
resulted in "foo/bar".
According to RFC 3986 it should however result in "bar".
See https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.3.
Fixes #4.
|
|
Previously an assertion like:
assert_eq!(Uri::parse("some/path"), Uri::parse("other/path"));
resulted in a panic like:
thread 'uri::tests::example' panicked at 'assertion failed: `(left == right)`
left: `Ok(Uri { scheme: None, authority: None, path: [[115, 111, 109, 101], [112, 97, 116, 104]], query: None, fragment: None })`,
right: `Ok(Uri { scheme: None, authority: None, path: [[111, 116, 104, 101, 114], [112, 97, 116, 104]], query: None, fragment: None })`'
This commit changes the Debug impl to be more developer friendly:
thread 'uri::tests::example' panicked at 'assertion failed: `(left == right)`
left: `Ok(Uri("some/path"))`,
right: `Ok(Uri("other/path"))`'
Fixes #3.
|
|
* Suppress more lints caused by `named_tuple`.
* Remove unnecessary `Result` from infallible functions.
|
|
Changes since 1.2.0:
* Disable `clippy::ref_option_ref` now triggered by
`named_tuple` macro.
* Add implementations of `TryFrom` for `&str`
and `String`.
|
|
|
|
|
|
|
|
|
|
|
|
* Code in doc examples needs to be reachable through a "main"
function, otherwise the tests silently fail to detect problems.
* The example for `Uri::resolve` was calling `path_to_string`
rather than `to_string`.
|
|
* Fixed bug in percent encoding of characters \x0 through \xF where
they were encoded as "%0" through "%F" rather than "%00" through "%0F".
|
|
|
|
* Suppress clippy::option_if_let_else in
parse_host_port::State::next_percent_encoded_character
because the warning recommends Option::map_or which
we cannot use because it leads to using a moved value.
* Use matches! instead in uri::Uri::is_path_absolute as recommended.
* Use and_then instead of if let/else in uri::Uri::port as recommended;
note we need to replace the & with as_ref for self.authority.
* In uri::Uri::resolve, replace the large if let/else with map_or
as recommended, although it's not clear if it makes it any
easier to read. ¯\_(ツ)_/¯
|
|
* Rename crate to "rhymuri" since "uri" is taken; FeelsBadMan
* Bump crate version to 1.0.0.
* Add categories, keywords, and repository metadata.
* Update README with links to crates.io and documentation.
* Add license reference in README.
|
|
Use "to_" prefix instead of "as_" for functions which create
values (expensive).
See: https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv
|
|
|
|
|
|
|
|
|
|
|