From e3a44552eed6bbae270f65ddc9719e4934351641 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 8 May 2019 08:12:49 +0200 Subject: [PATCH] src/api2/admin/datastore/h2upload.rs: code cleanups --- src/api2/admin/datastore/h2upload.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/api2/admin/datastore/h2upload.rs b/src/api2/admin/datastore/h2upload.rs index c504b687..1540184d 100644 --- a/src/api2/admin/datastore/h2upload.rs +++ b/src/api2/admin/datastore/h2upload.rs @@ -182,13 +182,8 @@ fn upgrade_h2upload( }) }) .select(abort_future.map_err(|_| {}).then(move |_| { bail!("task aborted"); })) - .then(|result| { - match result { - Ok((result,_)) => Ok(result), - Err((err, _)) => Err(err), - } - }) - + .and_then(|(result, _)| Ok(result)) + .map_err(|(err, _)| err) }).unwrap(); Ok(Box::new(futures::future::ok(