File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ async fn download(
74
74
) -> Result < ( ) > {
75
75
let url = url. to_string ( ) ;
76
76
let file_path = file_path. to_string ( ) ;
77
-
77
+
78
78
tokio:: spawn ( async move {
79
79
let client = reqwest:: Client :: new ( ) ;
80
80
let mut request = if let Some ( body) = body {
@@ -115,7 +115,7 @@ async fn download(
115
115
Ok ( ( ) )
116
116
} )
117
117
. 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 ( ) ) ) ) ?
119
119
}
120
120
121
121
#[ command]
@@ -127,7 +127,7 @@ async fn upload(
127
127
) -> Result < String > {
128
128
let url = url. to_string ( ) ;
129
129
let file_path = file_path. to_string ( ) ;
130
-
130
+
131
131
tokio:: spawn ( async move {
132
132
// Read the file
133
133
let file = File :: open ( & file_path) . await ?;
@@ -157,7 +157,7 @@ async fn upload(
157
157
}
158
158
} )
159
159
. 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 ( ) ) ) ) ?
161
161
}
162
162
163
163
fn file_to_body ( channel : Channel < ProgressPayload > , file : File , file_len : u64 ) -> reqwest:: Body {
You can’t perform that action at this time.
0 commit comments