diff --git a/src/typed/non_utf8/path.rs b/src/typed/non_utf8/path.rs index a3b0ed3..b9fdcd3 100644 --- a/src/typed/non_utf8/path.rs +++ b/src/typed/non_utf8/path.rs @@ -1,11 +1,9 @@ use alloc::borrow::Cow; use core::fmt; - -#[cfg(feature = "std")] -use std::path::Path; - #[cfg(all(feature = "std", not(target_family = "wasm")))] use std::io; +#[cfg(feature = "std")] +use std::path::Path; use crate::common::{CheckedPathError, StripPrefixError}; use crate::convert::TryAsRef; @@ -17,7 +15,7 @@ use crate::windows::WindowsPath; /// /// * [`UnixPath`] /// * [`WindowsPath`] -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum TypedPath<'a> { Unix(&'a UnixPath), Windows(&'a WindowsPath), diff --git a/src/typed/non_utf8/pathbuf.rs b/src/typed/non_utf8/pathbuf.rs index 4984463..8c461e8 100644 --- a/src/typed/non_utf8/pathbuf.rs +++ b/src/typed/non_utf8/pathbuf.rs @@ -1,7 +1,6 @@ use alloc::borrow::Cow; use alloc::collections::TryReserveError; use core::convert::TryFrom; - #[cfg(feature = "std")] use std::{io, path::PathBuf}; @@ -15,7 +14,7 @@ use crate::windows::{WindowsPath, WindowsPathBuf}; /// /// * [`UnixPathBuf`] /// * [`WindowsPathBuf`] -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum TypedPathBuf { Unix(UnixPathBuf), Windows(WindowsPathBuf), diff --git a/src/typed/utf8/path.rs b/src/typed/utf8/path.rs index 4f9180a..5c45dc5 100644 --- a/src/typed/utf8/path.rs +++ b/src/typed/utf8/path.rs @@ -1,5 +1,4 @@ use core::fmt; - #[cfg(feature = "std")] use std::path::Path; @@ -15,7 +14,7 @@ use crate::windows::Utf8WindowsPath; /// /// * [`Utf8UnixPath`] /// * [`Utf8WindowsPath`] -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum Utf8TypedPath<'a> { Unix(&'a Utf8UnixPath), Windows(&'a Utf8WindowsPath), diff --git a/src/typed/utf8/pathbuf.rs b/src/typed/utf8/pathbuf.rs index 7509922..13025c8 100644 --- a/src/typed/utf8/pathbuf.rs +++ b/src/typed/utf8/pathbuf.rs @@ -1,7 +1,6 @@ use alloc::collections::TryReserveError; use core::convert::TryFrom; use core::fmt; - #[cfg(feature = "std")] use std::path::PathBuf; @@ -17,7 +16,7 @@ use crate::windows::{Utf8WindowsPath, Utf8WindowsPathBuf}; /// /// * [`Utf8UnixPathBuf`] /// * [`Utf8WindowsPathBuf`] -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum Utf8TypedPathBuf { Unix(Utf8UnixPathBuf), Windows(Utf8WindowsPathBuf),