From 2cef51d7448206291b1ac92fdaf708a7e30c78a4 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 24 Feb 2026 16:44:56 +0800 Subject: Fix detection of trailing backslash in path formatting --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/fmt_path.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96e2fac..8d60fa0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "just_fmt" -version = "0.1.1" +version = "0.1.2" dependencies = [ "strip-ansi-escapes", ] diff --git a/Cargo.toml b/Cargo.toml index 2348af0..01a49d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" license = "MIT OR Apache-2.0" repository = "https://github.com/catilgrass/just_fmt" -version = "0.1.1" +version = "0.1.2" edition = "2024" [dependencies.strip-ansi-escapes] diff --git a/src/fmt_path.rs b/src/fmt_path.rs index e2c06a4..90a8d64 100644 --- a/src/fmt_path.rs +++ b/src/fmt_path.rs @@ -94,7 +94,7 @@ pub fn fmt_path_str_custom( config: &PathFormatConfig, ) -> Result { let path_result = path.into(); - let ends_with_slash = path_result.ends_with('/'); + let ends_with_slash = path_result.ends_with('/') || path_result.ends_with('\\'); // ANSI Strip #[cfg(feature = "strip-ansi")] -- cgit