Skip to content

Commit f518f9f

Browse files
hyf0claude
andcommitted
fix: address PR review comments and fix Windows CI
- Move `path::Path` import into unix-gated test to fix unused import warning on Windows (clippy -D warnings) - Fix comment: `base.normalize()` → `base.absolutize()` since normalize doesn't resolve relative bases against cwd Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 63dd737 commit f518f9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/impl_sugar_path.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl SugarPath for Path {
2929
// Unifying them (`&'a self, Cow<'a, Path>) -> Cow<'a, ...>`) would allow
3030
// borrowing from `base` for noop cases ("", "."), but it constrains callers:
3131
// base's borrowed data must outlive self. Callers needing "".absolutize_with(base)
32-
// can just call base.normalize() directly.
32+
// can just call base.absolutize() directly.
3333
fn absolutize_with<'a>(&self, base: Cow<'a, Path>) -> Cow<'_, Path> {
3434
if self.is_absolute() {
3535
return self.normalize();
@@ -662,7 +662,7 @@ fn replace_main_separator(input: &str) -> Option<String> {
662662

663663
#[cfg(test)]
664664
mod tests {
665-
use std::{borrow::Cow, path::Path, path::PathBuf};
665+
use std::{borrow::Cow, path::PathBuf};
666666

667667
use super::SugarPath;
668668

@@ -698,6 +698,7 @@ mod tests {
698698
#[cfg(target_family = "unix")]
699699
#[test]
700700
fn normalize() {
701+
use std::path::Path;
701702
assert_eq_str!(Path::new("/foo/../../../bar").normalize(), "/bar");
702703
assert_eq_str!(Path::new("a//b//../b").normalize(), "a/b");
703704
assert_eq_str!(Path::new("/foo/../../../bar").normalize(), "/bar");

0 commit comments

Comments
 (0)