From 198439ab3832e8fc699487c3faff5c280639110f Mon Sep 17 00:00:00 2001 From: Matthew Scheirer Date: Sun, 24 Sep 2017 14:16:31 -0400 Subject: [PATCH] Change unwraps to expects in library code - they should still NEVER fail --- src/issuer.rs | 6 +++--- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/issuer.rs b/src/issuer.rs index 5a29f72..23d2c99 100644 --- a/src/issuer.rs +++ b/src/issuer.rs @@ -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] diff --git a/src/lib.rs b/src/lib.rs index 4f01fb4..94c48ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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.