Change unwraps to expects in library code - they should still NEVER fail

This commit is contained in:
Matthew Scheirer 2017-09-24 14:16:31 -04:00
parent 08df147f5c
commit 198439ab38
2 changed files with 4 additions and 4 deletions

View File

@ -3,15 +3,15 @@ use reqwest::Url;
// TODO these should all be const, or even better, static Urls...
pub fn google() -> Url {
Url::parse("https://accounts.google.com").unwrap()
Url::parse("https://accounts.google.com").expect("Static urls should always work!")
}
pub fn paypal() -> Url {
Url::parse("https://www.paypalobjects.com/").unwrap()
Url::parse("https://www.paypalobjects.com/").expect("Static urls should always work!")
}
pub fn salesforce() -> Url {
Url::parse("https://login.salesforce.com").unwrap()
Url::parse("https://login.salesforce.com").expect("Static urls should always work!")
}
#[test]

View File

@ -144,7 +144,7 @@ impl Client {
/// Passthrough to the redirect_url stored in inth_oauth2 as a str.
pub fn redirect_url(&self) -> &str {
self.oauth.redirect_uri.as_ref().unwrap()
self.oauth.redirect_uri.as_ref().expect("We always require a redirect to construct client!")
}
/// Passthrough to the inth_oauth2::client's request token.