aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-05forgot to update repository URLmainMartin Fischer
2021-12-05reset version, update authors, credit in READMEMartin Fischer
2021-12-05update edition to 2021Martin Fischer
2021-12-05rename library to urisMartin Fischer
2021-12-05remove C++ implementationMartin Fischer
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-21Version 1.2.0Richard Walters
Changes since 1.2.0: * Fixed compiler warning about not using `split_prefix`. * Use newer `once_cell` (1.4 -> 1.5)
2020-12-21Fix compiler warningRichard Walters
2020-11-09Version 1.1.1Richard Walters
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.
2020-11-09Add .gitignoreRichard 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-28Version 1.1.0Richard Walters
* Added functions to remove parts of a URI and return them.
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-15Refactoring for encode_element; thanks to @Serayen for suggesting themRichard Walters
* 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!`).
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-15Add exclude list for crateRichard Walters
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-13Add description, license-file, and readme to Cargo.tomlRichard Walters
2020-10-13Update README to mention the Rust implementation.Richard Walters
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-13Make the Context and Error types publicRichard Walters
2020-10-13Add documentation (Rust)Richard Walters
2020-10-13Consolidate crate-wide warning attributes to crate level (lib.rs)Richard Walters
2020-10-13Fix issues using libraryRichard Walters
* Don't pull in all of the uri module as public. * To expose types publically, use "pub use" at crate level.
2020-10-13No need to use turbofish for collect in encode_elementRichard Walters
2020-10-13Reuse DIGIT character set in HEXDIGRichard Walters
2020-10-13Remove unnecessary allowRichard Walters
2020-10-13Sort functions by alphabetical orderRichard Walters
2020-10-13Move Uri to its own moduleRichard Walters
2020-10-13Move authority and codec functions to their own modulesRichard Walters
2020-10-13Rust refactoringRichard Walters
* 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.
2020-10-12Fix bugs in validating numbers of IPv6 address groupsRichard Walters
2020-10-12Replace lazy_static! with once_cell::sync::LazyRichard Walters
2020-10-12Remove unused staticsRichard Walters
2020-10-12Rust refactoringRichard Walters
* Move decode_element out of Uri impl. * Rewrite encode_element to be more functional. * Add test for empty port number.
2020-10-12Rust refactoringRichard Walters
* Dismiss todos. * Remove unused parens for multi-line ifs. * Explain at_directory_level variable in Uri::normalize_path.
2020-10-12Add ..._as_string methods to Uri for convenienceRichard Walters
2020-10-12Clean up tests in RustRichard Walters
* Use Uri::path_as_string() when convenient. * Remove unnecessary clones and temporary variables.
2020-10-12Rust refactoringRichard Walters
* 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.
2020-10-12Remove unnecessary blank lineRichard Walters
2020-10-12Make functions accepting references more generic using AsRefRichard Walters