feat: impl Hash for DirsAndFileName and PathParts

pull/24376/head
Marco Neumann 2021-05-06 11:33:23 +02:00
parent d726cf4829
commit fadf0176d4
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ use super::{ObjectStorePath, PathPart, DELIMITER};
use itertools::Itertools;
/// A path stored as a collection of 0 or more directories and 0 or 1 file name
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Default)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Hash)]
pub struct DirsAndFileName {
/// Directory hierarchy.
pub directories: Vec<PathPart>,

View File

@ -16,7 +16,7 @@ const EMPTY: &str = "%";
///
/// A PathPart instance is guaranteed to be non-empty and to contain no `/`
/// characters as it can only be constructed by going through the `from` impl.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Default)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Hash)]
pub struct PathPart(pub(super) String);
/// Characters we want to encode.