Apply suggestions from code review

This commit is contained in:
Waffle Maybe 2022-01-13 10:28:33 +03:00 committed by GitHub
parent cfb3c60a1c
commit 7958f37c60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -327,10 +327,7 @@ pub(crate) mod option_url_from_string {
let json = r#"{"url":""}"#; let json = r#"{"url":""}"#;
let url: Struct = serde_json::from_str(json).unwrap(); let url: Struct = serde_json::from_str(json).unwrap();
assert_eq!(url.url, None); assert_eq!(url.url, None);
assert_eq!( assert_eq!(serde_json::to_string(&url).unwrap(), json.to_owned());
serde_json::to_string(&url).unwrap(),
json.to_owned()
);
let json = r#"{"url":"https://github.com/token"}"#; let json = r#"{"url":"https://github.com/token"}"#;
let url: Struct = serde_json::from_str(json).unwrap(); let url: Struct = serde_json::from_str(json).unwrap();
@ -338,10 +335,7 @@ pub(crate) mod option_url_from_string {
url.url, url.url,
Some(Url::from_str("https://github.com/token").unwrap()) Some(Url::from_str("https://github.com/token").unwrap())
); );
assert_eq!( assert_eq!(serde_json::to_string(&url).unwrap(), json.to_owned());
serde_json::to_string(&url).unwrap(),
json.to_owned()
);
} }
} }
} }