From 7f7d0d18ad53092e6eefc064d9f53c53fc231e73 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Sun, 27 Sep 2020 14:24:26 -0700 Subject: No need to use try_from() when setting parts of a URI --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 61936fe..29e2c47 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1027,7 +1027,7 @@ mod tests { assert!(uri.is_ok()); let mut uri = uri.unwrap(); assert_eq!(None, uri.fragment()); - uri.set_fragment(uriparse::Fragment::try_from("").ok()).unwrap(); + uri.set_fragment(Some("")).unwrap(); assert_eq!( Some(&uriparse::Fragment::try_from("").unwrap()), uri.fragment() @@ -1053,7 +1053,7 @@ mod tests { assert!(uri.is_ok()); let mut uri = uri.unwrap(); assert_eq!(None, uri.query()); - uri.set_query(uriparse::Query::try_from("").ok()).unwrap(); + uri.set_query(Some("")).unwrap(); assert_eq!( Some(&uriparse::Query::try_from("").unwrap()), uri.query() -- cgit v1.2.3