Repository: starship/starship
File: src/modules/utils/path.rs (Rust)

Code before:
    }
}

#[cfg(windows)]
impl PathExt for Path {
    fn normalised_starts_with(&self, other: &Path) -> bool {
        // Do a structured comparison of two paths (normalising differences between path prefixes)
        let (a_prefix, a_path) = normalize::normalize_path(self);
        let (b_prefix, b_path) = normalize::normalize_path(other);
        a_prefix == b_prefix && a_path.starts_with(b_path)
    }

    fn normalised_equals(&self, other: &Path) -> bool {
        // Do a structured comparison of two paths (normalising differences between path prefixes)
        let (a_prefix, a_path) = normalize::normalize_path(self);
        let (b_prefix, b_path) = normalize::normalize_path(other);
        a_prefix == b_prefix && a_path == b_path
    }

    fn without_prefix(&self) -> &Path {
        let (_, path) = normalize::normalize_path(self);
        path
    }

    fn device_id(&self) -> u64 {
        // Maybe it should us unimplemented!
        42u64
    }
}

// NOTE: Windows path prefixes are only parsed on Windows.
// On other platforms, we can fall back to the non-normalized versions of these routines.
#[cfg(not(windows))]
impl PathExt for Path {
    #[inline]
    fn normalised_starts_with(&self, other: &Path) -> bool {
        self.starts_with(other)
    }

    #[inline]
    fn normalised_equals(&self, other: &Path) -> bool {
        self == other
    }

    #[inline]
    fn without_prefix(&self) -> &Path {
        self
    }

    #[cfg(target_os = "linux")]
    fn device_id(&self) -> u64 {

Review comment (suggestion):
Typo:
```suggestion
        // Maybe it should be implemented!
```

I wonder if [std::os::windows::fs::MetadataExt::volume_serial_number](https://doc.rust-lang.org/std/os/windows/fs/trait.MetadataExt.html#tymethod.volume_serial_number) will ever get stabilized

Code after:
    }
}

#[cfg(windows)]
impl PathExt for Path {
    fn normalised_starts_with(&self, other: &Path) -> bool {
        // Do a structured comparison of two paths (normalising differences between path prefixes)
        let (a_prefix, a_path) = normalize::normalize_path(self);
        let (b_prefix, b_path) = normalize::normalize_path(other);
        a_prefix == b_prefix && a_path.starts_with(b_path)
    }

    fn normalised_equals(&self, other: &Path) -> bool {
        // Do a structured comparison of two paths (normalising differences between path prefixes)
        let (a_prefix, a_path) = normalize::normalize_path(self);
        let (b_prefix, b_path) = normalize::normalize_path(other);
        a_prefix == b_prefix && a_path == b_path
    }

    fn without_prefix(&self) -> &Path {
        let (_, path) = normalize::normalize_path(self);
        path
    }

    fn device_id(&self) -> Option<u64> {
        // Maybe it should use unimplemented!
        Some(42u64)
    }
}

// NOTE: Windows path prefixes are only parsed on Windows.
// On other platforms, we can fall back to the non-normalized versions of these routines.
#[cfg(not(windows))]
impl PathExt for Path {
    #[inline]
    fn normalised_starts_with(&self, other: &Path) -> bool {
        self.starts_with(other)
    }

    #[inline]
    fn normalised_equals(&self, other: &Path) -> bool {
        self == other
    }

    #[inline]
    fn without_prefix(&self) -> &Path {
        self
    }

    #[cfg(target_os = "linux")]
    fn device_id(&self) -> Option<u64> {