From b731f182be20735a91986bcf0ca02035fd8ba42e Mon Sep 17 00:00:00 2001 From: Maxime Augier Date: Fri, 2 Aug 2024 11:45:52 +0200 Subject: [PATCH] Fix clippy lints --- src/api.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api.rs b/src/api.rs index 80d9467..cdd4e24 100644 --- a/src/api.rs +++ b/src/api.rs @@ -13,7 +13,7 @@ pub struct Context { token_expiration: Instant, } -const API_BASE: &'static str = "https://api.easee.com/api/"; +const API_BASE: &str = "https://api.easee.com/api/"; const REFRESH_TOKEN_DELAY: Duration = Duration::from_secs(600); #[derive(Clone,Copy,Debug,Eq,Ord,PartialEq,PartialOrd)] @@ -280,7 +280,7 @@ impl Context { let url = format!("{}accounts/refresh_token", API_BASE); let resp: LoginResponse = ureq::post(&url) .set("Content-type", "application/json") - .send_json(¶ms)? + .send_json(params)? .into_json_with_error()?; *self = Self::from_login_response(resp); @@ -313,7 +313,7 @@ impl Context { resp = req.call()? } - Ok(resp.into_json_with_error()?) + resp.into_json_with_error() } fn maybe_get(&mut self, path: &str) -> Result, ApiError> { @@ -341,7 +341,7 @@ impl Context { resp = req.send_json(params)? } - Ok(resp.into_json_with_error()?) + resp.into_json_with_error() } }