Skip to content

Commit

Permalink
fix borrow check error for path
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Aug 1, 2024
1 parent 9f7941a commit 5dd18a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ pub fn absolute_path(relative_path: &str, config: &Config) -> Option<PathBuf> {
pub fn relativize_path_maybe(path: &mut String, config: &Config) {
let mut inner_relativize = || -> Option<()> {
let base = config.cwd_relative_to_repo_root.as_deref()?;
let relative_path = pathdiff::diff_paths(&path, base)?;
let path_clone = path.clone();
let relative_path = pathdiff::diff_paths(&path_clone, base)?;
if relative_path.is_relative() {
#[cfg(target_os = "windows")]
// '/dev/null' is converted to '\dev\null' and considered relative. Work
Expand Down

0 comments on commit 5dd18a7

Please sign in to comment.