diff --git a/intel-mkl-tool/Cargo.toml b/intel-mkl-tool/Cargo.toml index 3d13772e..941bd0c1 100644 --- a/intel-mkl-tool/Cargo.toml +++ b/intel-mkl-tool/Cargo.toml @@ -14,13 +14,13 @@ default = ["cli"] cli = ["structopt", "env_logger"] [dependencies] +anyhow = "1.0.31" curl = "0.4.25" -failure = "0.1.6" -pkg-config = "0.3.17" -tar = "0.4.26" -log = "0.4.8" dirs = "2.0.2" glob = "0.3.0" +log = "0.4.8" +pkg-config = "0.3.17" +tar = "0.4.26" zstd = "0.5.1" # CLI diff --git a/intel-mkl-tool/src/cli.rs b/intel-mkl-tool/src/cli.rs index b91315cb..7802a408 100644 --- a/intel-mkl-tool/src/cli.rs +++ b/intel-mkl-tool/src/cli.rs @@ -1,4 +1,4 @@ -use failure::*; +use anyhow::*; use std::{env, path::PathBuf}; use structopt::StructOpt; @@ -22,7 +22,7 @@ enum Opt { Package { path: PathBuf }, } -fn main() -> Fallible<()> { +fn main() -> Result<()> { env::set_var("RUST_LOG", "info"); env_logger::init(); diff --git a/intel-mkl-tool/src/lib.rs b/intel-mkl-tool/src/lib.rs index 47e8b927..0e57a3b3 100644 --- a/intel-mkl-tool/src/lib.rs +++ b/intel-mkl-tool/src/lib.rs @@ -1,5 +1,5 @@ +use anyhow::*; use curl::easy::Easy; -use failure::*; use glob::glob; use log::*; use std::{ @@ -68,7 +68,7 @@ pub fn seek_home() -> Option { None } -pub fn download(out_dir: &Path) -> Fallible<()> { +pub fn download(out_dir: &Path) -> Result<()> { if !out_dir.exists() { info!("Create output directory: {}", out_dir.display()); fs::create_dir_all(out_dir)?; @@ -106,7 +106,7 @@ pub fn download(out_dir: &Path) -> Fallible<()> { } // Read mkl_version.h to get MKL version (e.g. 2019.5) -fn get_mkl_version(version_header: &Path) -> Fallible<(u32, u32)> { +fn get_mkl_version(version_header: &Path) -> Result<(u32, u32)> { if !version_header.exists() { bail!("MKL Version file not found: {}", version_header.display()); } @@ -133,7 +133,7 @@ fn get_mkl_version(version_header: &Path) -> Fallible<(u32, u32)> { Ok((year, update)) } -pub fn package(mkl_path: &Path) -> Fallible { +pub fn package(mkl_path: &Path) -> Result { if !mkl_path.exists() { bail!("MKL directory not found: {}", mkl_path.display()); }