diff options
| author | Xe Iaso <me@christine.website> | 2022-04-05 20:59:35 -0400 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-04-05 20:59:35 -0400 |
| commit | ea8e1e045ad28f96030d54c7544160f5f654806b (patch) | |
| tree | 4b1a216a3b2d245c1116f69c58c095268a978a6f /lib | |
| parent | 3a4827c887f348c80e29406d8aa995f79f1562b1 (diff) | |
| download | xesite-ea8e1e045ad28f96030d54c7544160f5f654806b.tar.xz xesite-ea8e1e045ad28f96030d54c7544160f5f654806b.zip | |
blow up without patrone
Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/patreon/src/lib.rs | 10 |
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, }) } |
