From bcdfed30f9c6c4dfdc67e78736be635dabf8da69 Mon Sep 17 00:00:00 2001 From: tatref Date: Tue, 12 Aug 2025 21:18:31 +0200 Subject: [PATCH 1/2] clippy --- src/ext.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext.rs b/src/ext.rs index ed1784f..c2cff91 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -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)) } } From b97b60438d6757bd603ecfbe61ccc4e72f7cbcb3 Mon Sep 17 00:00:00 2001 From: tatref Date: Tue, 12 Aug 2025 21:19:49 +0200 Subject: [PATCH 2/2] cargo fmt --- src/builder.rs | 2 +- src/ext.rs | 2 +- src/lib.rs | 6 ++++-- src/model/mod.rs | 8 ++++---- 4 files changed, 10 insertions(+), 8 deletions(-) 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 c2cff91..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}; 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.