Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<C = (), R = (), E = ()> {
credential: C,
Expand Down
4 changes: 2 additions & 2 deletions src/ext.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -63,7 +63,7 @@ impl ResponseExt for Response {

fn end<T: FromResponse>(self) -> Result<T> {
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))
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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<u64> {
Expand Down
8 changes: 4 additions & 4 deletions src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading