diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-10-16 15:04:04 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-10-16 15:04:04 -0700 |
commit | bc57f058e630f9f2e53867b48e0e710c72d7d8ec (patch) | |
tree | ac48bef9f4195b520d426b5048f6b7f35caeb157 /src/uri.rs | |
parent | df19e6b005c6a08e2b068ec0468c50db31387002 (diff) |
Version 1.0.2
* 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`.
Diffstat (limited to 'src/uri.rs')
-rw-r--r-- | src/uri.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -39,7 +39,7 @@ use super::character_classes::{ /// # extern crate rhymuri; /// use rhymuri::Uri; /// -/// # fn test() -> Result<(), rhymuri::Error> { +/// # fn main() -> Result<(), rhymuri::Error> { /// let uri = Uri::parse("http://www.example.com/foo?bar#baz")?; /// let authority = uri.authority().unwrap(); /// assert_eq!("www.example.com".as_bytes(), authority.host()); @@ -229,7 +229,7 @@ impl Uri { /// # extern crate rhymuri; /// use rhymuri::Uri; /// - /// # fn test() -> Result<(), rhymuri::Error> { + /// # fn main() -> Result<(), rhymuri::Error> { /// let mut uri = Uri::parse("/a/b/c/./../../g")?; /// uri.normalize(); /// assert_eq!("/a/g", uri.path_to_string()?); @@ -489,11 +489,11 @@ impl Uri { /// # extern crate rhymuri; /// use rhymuri::Uri; /// - /// # fn test() -> Result<(), rhymuri::Error> { + /// # fn main() -> Result<(), rhymuri::Error> { /// let base = Uri::parse("http://a/b/c/d;p?q")?; /// let relative_reference = Uri::parse("g;x?y#s")?; /// let resolved = base.resolve(&relative_reference); - /// assert_eq!("http://a/b/c/g;x?y#s", resolved.path_to_string()?); + /// assert_eq!("http://a/b/c/g;x?y#s", resolved.to_string()); /// # Ok(()) /// # } /// ``` @@ -1300,7 +1300,7 @@ mod tests { let base_uri = Uri::parse(test_vector.base_string()).unwrap(); let relative_reference_uri = Uri::parse(test_vector.relative_reference_string()).unwrap(); let expected_target_uri = Uri::parse(test_vector.target_string()).unwrap(); - let actual_target_uri = base_uri.resolve(&relative_reference_uri); + let actual_target_uri = dbg!(base_uri.resolve(&relative_reference_uri)); assert_eq!(expected_target_uri, actual_target_uri); } } |