diff --git a/src/app/operations/globals.rs b/src/app/operations/globals.rs index 251fa55..e20bb1c 100644 --- a/src/app/operations/globals.rs +++ b/src/app/operations/globals.rs @@ -1,9 +1,9 @@ -use anyhow::{Context, Result}; +use anyhow::Context; use crate::app::App; impl App { - pub async fn globals(&self) -> Result<()> { + pub async fn globals(&self) -> anyhow::Result<()> { let globals = self .client .globals() diff --git a/src/app/operations/intraledger.rs b/src/app/operations/intraledger.rs index f2f3a8f..4c3ae32 100644 --- a/src/app/operations/intraledger.rs +++ b/src/app/operations/intraledger.rs @@ -1,4 +1,4 @@ -use anyhow::{Context, Result}; +use anyhow::Context; use rust_decimal::Decimal; @@ -12,7 +12,7 @@ impl App { cents: Option, sats: Option, memo: Option, - ) -> Result<()> { + ) -> anyhow::Result<()> { let recipient_wallet_id = self.client.default_wallet(username.clone()).await?; match (wallet, sats, cents) { diff --git a/src/app/operations/onchain.rs b/src/app/operations/onchain.rs index c61724b..214c23c 100644 --- a/src/app/operations/onchain.rs +++ b/src/app/operations/onchain.rs @@ -1,4 +1,4 @@ -use anyhow::{Context, Result}; +use anyhow::Context; use rust_decimal::Decimal; use crate::{ @@ -14,7 +14,7 @@ impl App { cents: Option, sats: Option, memo: Option, - ) -> Result<()> { + ) -> anyhow::Result<()> { match (wallet, sats, cents) { (Wallet::Btc, Some(sats), _) => { let btc_wallet_id = self.get_user_btc_wallet_id().await?; diff --git a/src/app/operations/request_code.rs b/src/app/operations/request_code.rs index f81eb39..d8697f8 100644 --- a/src/app/operations/request_code.rs +++ b/src/app/operations/request_code.rs @@ -1,4 +1,4 @@ -use anyhow::{Context, Result}; +use anyhow::Context; use std::net::TcpListener; use webbrowser; @@ -7,7 +7,7 @@ use crate::app::{file_manager, server::server::run, App}; const PORT: u16 = 42909; impl App { - pub async fn request_phone_code(&self, phone: String) -> Result<()> { + pub async fn request_phone_code(&self, phone: String) -> anyhow::Result<()> { let listener = TcpListener::bind(format!("127.0.0.1:{}", PORT))?; let url = format!("http://127.0.0.1:{}/login", PORT); @@ -26,7 +26,7 @@ impl App { .await? } - pub async fn request_email_code(&self, email: String) -> Result<()> { + pub async fn request_email_code(&self, email: String) -> anyhow::Result<()> { let result = self .client .request_email_code(email) diff --git a/src/app/operations/wallet.rs b/src/app/operations/wallet.rs index 4cb5bff..51ab865 100644 --- a/src/app/operations/wallet.rs +++ b/src/app/operations/wallet.rs @@ -1,6 +1,6 @@ use std::collections::HashSet; -use anyhow::{Context, Result}; +use anyhow::Context; use crate::{ app::{errors::payment_error::PaymentError, App}, @@ -11,7 +11,7 @@ use crate::{ }; impl App { - pub async fn default_wallet(&self, username: String) -> Result<()> { + pub async fn default_wallet(&self, username: String) -> anyhow::Result<()> { let result = self .client .default_wallet(username.clone()) @@ -26,7 +26,7 @@ impl App { &self, wallet: Option, wallet_id: Option, - ) -> Result<()> { + ) -> anyhow::Result<()> { let wallet_id = if let Some(wallet_id) = wallet_id { wallet_id } else { @@ -59,7 +59,7 @@ impl App { btc: bool, usd: bool, wallet_ids: Vec, - ) -> Result<()> { + ) -> anyhow::Result<()> { let me = self.client.me().await?; let default_wallet_id = me.default_account.default_wallet_id; let wallets = &me.default_account.wallets; @@ -95,7 +95,7 @@ impl App { Ok(()) } - pub async fn get_user_btc_wallet_id(&self) -> Result { + pub async fn get_user_btc_wallet_id(&self) -> anyhow::Result { let me = self.client.me().await?; let wallets = me.default_account.wallets; @@ -108,7 +108,7 @@ impl App { Ok(btc_wallet_id) } - pub async fn get_user_usd_wallet_id(&self) -> Result { + pub async fn get_user_usd_wallet_id(&self) -> anyhow::Result { let me = self.client.me().await?; let wallets = me.default_account.wallets; diff --git a/src/app/server/server.rs b/src/app/server/server.rs index a3eaf5b..78d11ff 100644 --- a/src/app/server/server.rs +++ b/src/app/server/server.rs @@ -1,5 +1,5 @@ use actix_web::{web, App, HttpResponse, HttpServer, Responder}; -use anyhow::Result; +use anyhow; use mime_guess::from_path; use rust_embed::RustEmbed; use serde::{Deserialize, Serialize}; @@ -96,7 +96,7 @@ pub async fn run( phone: String, api: String, captcha_challenge_result: CaptchaChallenge, -) -> Result<()> { +) -> anyhow::Result<()> { let mut tera = Tera::default(); tera.add_raw_template("login.tera.html", include_str!("./public/login.tera.html"))?;