From 5645abe9e4a78b8296d9f94df9bd343aaebdee65 Mon Sep 17 00:00:00 2001 From: Matthew Richardson Date: Fri, 11 Jul 2025 17:47:46 +0100 Subject: [PATCH] fix: Fix upload command not returning --- plugins/upload/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/upload/src/lib.rs b/plugins/upload/src/lib.rs index 36f3e715..fd9eb026 100644 --- a/plugins/upload/src/lib.rs +++ b/plugins/upload/src/lib.rs @@ -74,7 +74,7 @@ async fn download( ) -> Result<()> { let url = url.to_string(); let file_path = file_path.to_string(); - + tokio::spawn(async move { let client = reqwest::Client::new(); let mut request = if let Some(body) = body { @@ -115,7 +115,7 @@ async fn download( Ok(()) }) .await - .map_err(|e| Error::Io(std::io::Error::new(std::io::ErrorKind::Other, e.to_string())))? + .map_err(|e| Error::Io(std::io::Error::other(e.to_string())))? } #[command] @@ -127,7 +127,7 @@ async fn upload( ) -> Result { let url = url.to_string(); let file_path = file_path.to_string(); - + tokio::spawn(async move { // Read the file let file = File::open(&file_path).await?; @@ -157,7 +157,7 @@ async fn upload( } }) .await - .map_err(|e| Error::Io(std::io::Error::new(std::io::ErrorKind::Other, e.to_string())))? + .map_err(|e| Error::Io(std::io::Error::other(e.to_string())))? } fn file_to_body(channel: Channel, file: File, file_len: u64) -> reqwest::Body {