diff --git a/src/configs/fossil_branch.rs b/src/configs/fossil_branch.rs index c2d6b912..b932795c 100644 --- a/src/configs/fossil_branch.rs +++ b/src/configs/fossil_branch.rs @@ -22,7 +22,7 @@ impl<'a> Default for FossilBranchConfig<'a> { format: "on [$symbol$branch]($style) ", symbol: " ", style: "bold purple", - truncation_length: std::i64::MAX, + truncation_length: i64::MAX, truncation_symbol: "…", disabled: true, } diff --git a/src/configs/git_branch.rs b/src/configs/git_branch.rs index 5bf4a4e3..03c8aa8d 100644 --- a/src/configs/git_branch.rs +++ b/src/configs/git_branch.rs @@ -25,7 +25,7 @@ impl<'a> Default for GitBranchConfig<'a> { format: "on [$symbol$branch(:$remote_branch)]($style) ", symbol: " ", style: "bold purple", - truncation_length: std::i64::MAX, + truncation_length: i64::MAX, truncation_symbol: "…", only_attached: false, always_show_remote: false, diff --git a/src/configs/hg_branch.rs b/src/configs/hg_branch.rs index fff150c9..af5f874a 100644 --- a/src/configs/hg_branch.rs +++ b/src/configs/hg_branch.rs @@ -22,7 +22,7 @@ impl<'a> Default for HgBranchConfig<'a> { symbol: " ", style: "bold purple", format: "on [$symbol$branch(:$topic)]($style) ", - truncation_length: std::i64::MAX, + truncation_length: i64::MAX, truncation_symbol: "…", disabled: true, } diff --git a/src/configs/meson.rs b/src/configs/meson.rs index 0325c3f5..d6b6e20e 100644 --- a/src/configs/meson.rs +++ b/src/configs/meson.rs @@ -19,7 +19,7 @@ pub struct MesonConfig<'a> { impl<'a> Default for MesonConfig<'a> { fn default() -> Self { MesonConfig { - truncation_length: std::u32::MAX, + truncation_length: u32::MAX, truncation_symbol: "…", format: "via [$symbol$project]($style) ", symbol: "⬢ ", diff --git a/src/configs/pijul_channel.rs b/src/configs/pijul_channel.rs index 031bea6c..0bb28a69 100644 --- a/src/configs/pijul_channel.rs +++ b/src/configs/pijul_channel.rs @@ -22,7 +22,7 @@ impl<'a> Default for PijulConfig<'a> { symbol: " ", style: "bold purple", format: "on [$symbol$channel]($style) ", - truncation_length: std::i64::MAX, + truncation_length: i64::MAX, truncation_symbol: "…", disabled: true, } diff --git a/src/modules/fossil_branch.rs b/src/modules/fossil_branch.rs index 7cc4d331..86983c2e 100644 --- a/src/modules/fossil_branch.rs +++ b/src/modules/fossil_branch.rs @@ -33,7 +33,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { "\"truncation_length\" should be a positive value, found {}", config.truncation_length ); - std::usize::MAX + usize::MAX } else { config.truncation_length as usize }; diff --git a/src/modules/git_branch.rs b/src/modules/git_branch.rs index cda4065c..95c5c20a 100644 --- a/src/modules/git_branch.rs +++ b/src/modules/git_branch.rs @@ -19,7 +19,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { "\"truncation_length\" should be a positive value, found {}", config.truncation_length ); - std::usize::MAX + usize::MAX } else { config.truncation_length as usize }; diff --git a/src/modules/git_status.rs b/src/modules/git_status.rs index d1dd4c09..c71f1d2b 100644 --- a/src/modules/git_status.rs +++ b/src/modules/git_status.rs @@ -426,13 +426,13 @@ fn git_status_wsl(context: &Context, conf: &GitStatusConfig) -> Option { log::trace!("Using WSL mode"); // Get Windows path - let winpath = match create_command("wslpath") + let wslpath = create_command("wslpath") .map(|mut c| { c.arg("-w").arg(&context.current_dir); c }) - .and_then(|mut c| c.output()) - { + .and_then(|mut c| c.output()); + let winpath = match wslpath { Ok(r) => r, Err(e) => { // Not found might means this might not be WSL after all @@ -472,7 +472,7 @@ fn git_status_wsl(context: &Context, conf: &GitStatusConfig) -> Option { |e| e + ":STARSHIP_CONFIG/wp", ); - let out = match create_command(starship_exe) + let exe = create_command(starship_exe) .map(|mut c| { c.env( "STARSHIP_CONFIG", @@ -484,8 +484,9 @@ fn git_status_wsl(context: &Context, conf: &GitStatusConfig) -> Option { .args(["module", "git_status", "--path", winpath]); c }) - .and_then(|mut c| c.output()) - { + .and_then(|mut c| c.output()); + + let out = match exe { Ok(r) => r, Err(e) => { log::error!("Failed to run Git Status module on Windows:\n{}", e); diff --git a/src/modules/hg_branch.rs b/src/modules/hg_branch.rs index c4c4a2a3..ffc20dca 100644 --- a/src/modules/hg_branch.rs +++ b/src/modules/hg_branch.rs @@ -26,7 +26,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { "\"truncation_length\" should be a positive value, found {}", config.truncation_length ); - std::usize::MAX + usize::MAX } else { config.truncation_length as usize };