diff --git a/src/builder.rs b/src/builder.rs index e1bd31f..3c7c2fb 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -6,7 +6,7 @@ use reqwest::Client; use tap::Pipe; use url::Url; -use crate::{ext::Cookie, model::Credential, LoginState, Qbit}; +use crate::{LoginState, Qbit, ext::Cookie, model::Credential}; pub struct QbitBuilder { credential: C, diff --git a/src/ext.rs b/src/ext.rs index ed1784f..541849a 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -1,4 +1,4 @@ -use reqwest::{header::SET_COOKIE, Response, StatusCode}; +use reqwest::{Response, StatusCode, header::SET_COOKIE}; use tap::Pipe; use crate::{ApiError, Error, Result}; @@ -63,7 +63,7 @@ impl ResponseExt for Response { fn end(self) -> Result { self.map_status(|c| Error::UnknownHttpCode(c).pipe(Some)) - .and_then(|b| T::from_response(&b).map_err(Into::into)) + .and_then(|b| T::from_response(&b)) } } diff --git a/src/lib.rs b/src/lib.rs index cd40680..26cd574 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,7 @@ use std::{ pub mod model; pub use builder::QbitBuilder; use bytes::Bytes; -use reqwest::{header, Client, Method, Response, StatusCode}; +use reqwest::{Client, Method, Response, StatusCode, header}; use serde::Serialize; use serde_with::skip_serializing_none; use tap::{Pipe, TapFallible}; @@ -282,7 +282,9 @@ impl Qbit { } pub async fn toggle_speed_limits_mode(&self) -> Result<()> { - self.post("transfer/toggleSpeedLimitsMode", None::<&()>).await?.end() + self.post("transfer/toggleSpeedLimitsMode", None::<&()>) + .await? + .end() } pub async fn get_download_limit(&self) -> Result { diff --git a/src/model/mod.rs b/src/model/mod.rs index 5aa17b5..aa8777e 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -86,16 +86,16 @@ pub struct Tracker { #[repr(i8)] pub enum TrackerStatus { /// Tracker is disabled (used for DHT, PeX, and LSD) - Disabled = 0, + Disabled = 0, /// Tracker has not been contacted yet NotContacted = 1, /// Tracker has been contacted and is working - Working = 2, + Working = 2, /// Tracker is updating - Updating = 3, + Updating = 3, /// Tracker has been contacted, but it is not working (or doesn't send /// proper replies) - NotWorking = 4, + NotWorking = 4, } /// Type that can be either an integer or a string.