Skip to content

Commit 0d87d2d

Browse files
authored
Merge pull request #9 from dodomorandi/retr-generic-error
Make FtpStream::retr error return type generic
2 parents 19a7a18 + 8d3e04d commit 0d87d2d

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
@@ -341,10 +341,11 @@ impl FtpStream {
341341
/// assert!(conn.rm("retr.txt").await.is_ok());
342342
/// };
343343
/// ```
344-
pub async fn retr<F, T, P>(&mut self, filename: &str, reader: F) -> Result<T>
344+
pub async fn retr<F, T, P, E>(&mut self, filename: &str, reader: F) -> std::result::Result<T, E>
345345
where
346346
F: Fn(BufReader<DataStream>) -> P,
347-
P: std::future::Future<Output = Result<T>>,
347+
P: std::future::Future<Output = std::result::Result<T, E>>,
348+
E: From<FtpError>,
348349
{
349350
let retr_command = format!("RETR {}\r\n", filename);
350351

0 commit comments

Comments
 (0)