Skip to content

Commit 3d030df

Browse files
fix: Fix upload command not returning
1 parent 5bb81d0 commit 3d030df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/upload/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async fn download(
7474
) -> Result<()> {
7575
let url = url.to_string();
7676
let file_path = file_path.to_string();
77-
77+
7878
tokio::spawn(async move {
7979
let client = reqwest::Client::new();
8080
let mut request = if let Some(body) = body {
@@ -115,7 +115,7 @@ async fn download(
115115
Ok(())
116116
})
117117
.await
118-
.map_err(|e| Error::Io(std::io::Error::new(std::io::ErrorKind::Other, e.to_string())))?
118+
.map_err(|e| Error::Io(std::io::Error::other(e.to_string())))?
119119
}
120120

121121
#[command]
@@ -127,7 +127,7 @@ async fn upload(
127127
) -> Result<String> {
128128
let url = url.to_string();
129129
let file_path = file_path.to_string();
130-
130+
131131
tokio::spawn(async move {
132132
// Read the file
133133
let file = File::open(&file_path).await?;
@@ -157,7 +157,7 @@ async fn upload(
157157
}
158158
})
159159
.await
160-
.map_err(|e| Error::Io(std::io::Error::new(std::io::ErrorKind::Other, e.to_string())))?
160+
.map_err(|e| Error::Io(std::io::Error::other(e.to_string())))?
161161
}
162162

163163
fn file_to_body(channel: Channel<ProgressPayload>, file: File, file_len: u64) -> reqwest::Body {

0 commit comments

Comments
 (0)