Skip to content

Commit 8d3e04d

Browse files
committed
Make retr error return type generic
1 parent 92fb11b commit 8d3e04d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ftp.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,11 @@ impl FtpStream {
337337
/// assert!(conn.rm("retr.txt").await.is_ok());
338338
/// };
339339
/// ```
340-
pub async fn retr<F, T, P>(&mut self, filename: &str, reader: F) -> Result<T>
340+
pub async fn retr<F, T, P, E>(&mut self, filename: &str, reader: F) -> std::result::Result<T, E>
341341
where
342342
F: Fn(BufReader<DataStream>) -> P,
343-
P: std::future::Future<Output = Result<T>>,
343+
P: std::future::Future<Output = std::result::Result<T, E>>,
344+
E: From<FtpError>,
344345
{
345346
let retr_command = format!("RETR {}\r\n", filename);
346347

0 commit comments

Comments
 (0)