diff --git a/you-have-mail-mobile/src/account.rs b/you-have-mail-mobile/src/account.rs index 1c0fd55..30a9870 100644 --- a/you-have-mail-mobile/src/account.rs +++ b/you-have-mail-mobile/src/account.rs @@ -1,6 +1,6 @@ +use crate::events::Event; use chrono::{DateTime, Local}; use you_have_mail_common as yhm; -use crate::events::Event; /// An account in the system. #[derive(uniffi::Object)] diff --git a/you-have-mail-mobile/src/backend/proton.rs b/you-have-mail-mobile/src/backend/proton.rs index 84638e8..3ece690 100644 --- a/you-have-mail-mobile/src/backend/proton.rs +++ b/you-have-mail-mobile/src/backend/proton.rs @@ -135,7 +135,6 @@ pub struct ProtonLoginSequence { #[uniffi::export] impl ProtonLoginSequence { - /// Create new instance. /// /// # Errors @@ -260,12 +259,14 @@ impl ProtonLoginSequence { /// # Errors /// /// Returns error if request failed. - pub fn captcha(&self, token:&str) -> Result { + pub fn captcha(&self, token: &str) -> Result { let mut guard = self.sequence.lock(); let Some(sequence) = guard.take() else { return Err(ProtonLoginError::Invalid); }; - Ok(sequence.session().execute(GetCaptchaRequest::new(token,false))?) + Ok(sequence + .session() + .execute(GetCaptchaRequest::new(token, false))?) } } diff --git a/you-have-mail-mobile/src/proxy.rs b/you-have-mail-mobile/src/proxy.rs index 503f183..e51b1ff 100644 --- a/you-have-mail-mobile/src/proxy.rs +++ b/you-have-mail-mobile/src/proxy.rs @@ -1,5 +1,5 @@ -use tracing::error; use crate::yhm::YhmError; +use tracing::error; use you_have_mail_common as yhm; use you_have_mail_common::backend::proton::proton_api::client::ProtonExtension; use you_have_mail_common::backend::proton::proton_api::requests::Ping; @@ -21,7 +21,7 @@ impl From for Protocol { } } -impl From for yhm::http::ProxyProtocol{ +impl From for yhm::http::ProxyProtocol { fn from(value: Protocol) -> Self { match value { Protocol::Http => yhm::http::ProxyProtocol::Http, @@ -79,7 +79,7 @@ impl From for Proxy { } impl From for yhm::http::Proxy { - fn from(value:Proxy) -> Self { + fn from(value: Proxy) -> Self { yhm::http::Proxy { protocol: value.protocol.into(), host: value.host, @@ -87,7 +87,6 @@ impl From for yhm::http::Proxy { port: value.port, } } - } /// Test a proxy by constructing a client and trying to ping a server. @@ -104,11 +103,9 @@ pub fn test_proxy(proxy: Proxy) -> Result<(), YhmError> { error!("Failed to build client with proxy: {e}"); YhmError::ProxyTest(e.to_string()) })?; - client - .execute(&Ping {}) - .map_err(|e| { - error!("Failed ping server using proxy: {e}"); - YhmError::ProxyTest(e.to_string()) - })?; + client.execute(&Ping {}).map_err(|e| { + error!("Failed ping server using proxy: {e}"); + YhmError::ProxyTest(e.to_string()) + })?; Ok(()) }