mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 15:49:27 +01:00
Apply suggestions from code review
This commit is contained in:
parent
cfb3c60a1c
commit
7958f37c60
1 changed files with 2 additions and 8 deletions
10
src/types.rs
10
src/types.rs
|
@ -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()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue