aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/patreon/src/lib.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/patreon/src/lib.rs b/lib/patreon/src/lib.rs
index a102574..06c952c 100644
--- a/lib/patreon/src/lib.rs
+++ b/lib/patreon/src/lib.rs
@@ -125,18 +125,14 @@ pub struct Links {
impl Client {
pub fn new() -> Result<Self> {
- let mut creds = Credentials::default();
-
let p = Path::new(".patreon.json");
- if p.exists() {
- let config = fs::read_to_string(p)?;
- creds = serde_json::from_str(&config)?;
- }
+ let config = fs::read_to_string(p)?;
+ let creds: Credentials = serde_json::from_str(&config)?;
Ok(Self {
cli: reqwest::Client::new(),
base_url: "https://api.patreon.com".into(),
- creds: creds,
+ creds,
})
}