Change unwraps to expects in library code - they should still NEVER fail
This commit is contained in:
parent
08df147f5c
commit
198439ab38
|
@ -3,15 +3,15 @@ use reqwest::Url;
|
||||||
// TODO these should all be const, or even better, static Urls...
|
// TODO these should all be const, or even better, static Urls...
|
||||||
|
|
||||||
pub fn google() -> Url {
|
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 {
|
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 {
|
pub fn salesforce() -> Url {
|
||||||
Url::parse("https://login.salesforce.com").unwrap()
|
Url::parse("https://login.salesforce.com").expect("Static urls should always work!")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -144,7 +144,7 @@ impl Client {
|
||||||
|
|
||||||
/// Passthrough to the redirect_url stored in inth_oauth2 as a str.
|
/// Passthrough to the redirect_url stored in inth_oauth2 as a str.
|
||||||
pub fn redirect_url(&self) -> &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.
|
/// Passthrough to the inth_oauth2::client's request token.
|
||||||
|
|
Loading…
Reference in New Issue