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`.
|
|
Changes since 1.2.0:
* Fixed compiler warning about not using `split_prefix`.
* Use newer `once_cell` (1.4 -> 1.5)
|
|
|
|
Changes since 1.1.0:
* Added rustfmt.toml and used it to format the code.
* Added .gitignore.
* Fixed new warnings/lints raised by latest toolchain.
|
|
|
|
|
|
|
|
|
|
* Added functions to remove parts of a URI and return them.
|
|
|
|
* 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`.
|
|
* We can write! directly into a String (as lone as we use std::fmt::Write).
* We can pre-allocate the encoded String with an estimate of the number
of bytes we need. If we need more, String will allocate more, and only
in doubles (not every `push` or `write!`).
|
|
* 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
|
|
|
|
|
|
|
|
|
|
* Don't pull in all of the uri module as public.
* To expose types publically, use "pub use" at crate level.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Move Context, Error, and character classes to their own modules.
* Move host/port parsing and IP address validation to their
own modules, and break the code up into different functions
to process their state machines.
|
|
|
|
|
|
|
|
* Move decode_element out of Uri impl.
* Rewrite encode_element to be more functional.
* Add test for empty port number.
|
|
* Dismiss todos.
* Remove unused parens for multi-line ifs.
* Explain at_directory_level variable in Uri::normalize_path.
|
|
|
|
* Use Uri::path_as_string() when convenient.
* Remove unnecessary clones and temporary variables.
|
|
* Use Into trait for setters to accept input.
* Make input to Uri::check_scheme more flexible.
* Rewrite Uri::set_path_from_str to use match so as
not to shadow path, and no need for 'a lifetime.
* Rewrite Uri::set_scheme to use match.
|
|
|
|
|
|
|
|
|