From 0fec41cfb88d4c556d149d84a3d1a490476c011d Mon Sep 17 00:00:00 2001 From: Cole K Date: Mon, 9 Jan 2023 17:45:22 -0800 Subject: [PATCH] cargo fmt --- flux-bin/src/bin/rustc-flux.rs | 3 ++- flux-bin/src/utils.rs | 17 +++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/flux-bin/src/bin/rustc-flux.rs b/flux-bin/src/bin/rustc-flux.rs index 2406f58c35..b2bfb9bcf9 100644 --- a/flux-bin/src/bin/rustc-flux.rs +++ b/flux-bin/src/bin/rustc-flux.rs @@ -5,7 +5,8 @@ use std::{ use anyhow::Result; use flux_bin::utils::{ - extend_env_var_with_path, get_ld_library_path, get_rust_toolchain, EXIT_ERR, LIB_PATH, get_flux_path, + extend_env_var_with_path, get_flux_path, get_ld_library_path, get_rust_toolchain, EXIT_ERR, + LIB_PATH, }; fn main() { diff --git a/flux-bin/src/utils.rs b/flux-bin/src/utils.rs index 8f7feaa1b1..42d72733df 100644 --- a/flux-bin/src/utils.rs +++ b/flux-bin/src/utils.rs @@ -12,8 +12,7 @@ pub const LIB_PATH: &str = "DYLD_FALLBACK_LIBRARY_PATH"; pub const EXIT_ERR: i32 = -1; pub fn get_default_flux_path() -> Result { - let mut default_flux_path = env::current_exe() - .map(|path| path.with_file_name("flux"))?; + let mut default_flux_path = env::current_exe().map(|path| path.with_file_name("flux"))?; if cfg!(target_os = "windows") { default_flux_path.set_extension("exe"); } @@ -21,14 +20,12 @@ pub fn get_default_flux_path() -> Result { } pub fn get_flux_path() -> Result { - let flux_path = env::var("FLUX_PATH") - .map(PathBuf::from) - .or_else(|err| { - match err { - env::VarError::NotPresent => get_default_flux_path(), - _ => Err(anyhow::Error::from(err)) - } - })?; + let flux_path = env::var("FLUX_PATH").map(PathBuf::from).or_else(|err| { + match err { + env::VarError::NotPresent => get_default_flux_path(), + _ => Err(anyhow::Error::from(err)), + } + })?; if !flux_path.is_file() { return Err(anyhow!("flux executable {:?} does not exist or is not a file", flux_path)); }