Simplify match expression

master
Mackiovello 7 years ago
parent 840c7bd03c
commit 035bcbe688
  1. 14
      src/command/pack.rs

@ -10,14 +10,12 @@ pub fn pack(path: Option<String>, log: &Logger) -> result::Result<(), Error> {
info!(&log, "Packing up the npm package..."); info!(&log, "Packing up the npm package...");
match npm::npm_pack(&crate_path) { match npm::npm_pack(&crate_path) {
Ok(r) => r, Ok(r) => Ok(r),
Err(Error::Io { .. }) => { Err(Error::Io { .. }) => Err(Error::DirNotFound {
return Err(Error::DirNotFound { message: "Unable to find the pkg directory".to_owned(),
message: "Unable to find the pkg directory".to_owned(), }),
}); Err(e) => Err(e),
} }?;
Err(e) => return Err(e),
};
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]
info!(&log, "Your package is located at {}/pkg", &crate_path); info!(&log, "Your package is located at {}/pkg", &crate_path);
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]

Loading…
Cancel
Save