aboutsummaryrefslogtreecommitdiff
path: root/src/uri.rs
AgeCommit message (Collapse)Author
2021-12-05Fix Uri::resolve for base URIs without authorityMartin Fischer
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.
2021-12-05Make Debug impl of Uri developer friendlyMartin Fischer
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.
2021-03-29Version 1.3.1Richard Walters
* Suppress more lints caused by `named_tuple`. * Remove unnecessary `Result` from infallible functions.
2021-01-16Version 1.3.0Richard Walters
Changes since 1.2.0: * Disable `clippy::ref_option_ref` now triggered by `named_tuple` macro. * Add implementations of `TryFrom` for `&str` and `String`.
2020-12-21Fix compiler warningRichard Walters
2020-10-30Fix documentation warnings caused by recent Rust tool changesRichard Walters
2020-10-30Fix new warnings from latest Rust toolsRichard Walters
2020-10-30Add and apply rustfmt configurationRichard Walters
2020-10-23Add functions to remove parts of a URI and return themRichard Walters
2020-10-16Version 1.0.2Richard Walters
* 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`.
2020-10-15Version 1.0.1Richard Walters
* Fixed bug in percent encoding of characters \x0 through \xF where they were encoded as "%0" through "%F" rather than "%00" through "%0F".
2020-10-14Distribute tests closer to the code they testRichard Walters
2020-10-14Fix new clippy warningsRichard Walters
* 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. ¯\_(ツ)_/¯
2020-10-14Preparation for publishing on crates.ioRichard Walters
* 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.
2020-10-13Fix issue with namingRichard Walters
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
2020-10-13Add test vector to test Error::TooManyDigitsRichard Walters
2020-10-13Add documentation (Rust)Richard Walters
2020-10-13Consolidate crate-wide warning attributes to crate level (lib.rs)Richard Walters
2020-10-13Sort functions by alphabetical orderRichard Walters
2020-10-13Move Uri to its own moduleRichard Walters