Skip to content

Commit

Permalink
chore: Fix nightly warning
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus23 committed Feb 14, 2024
1 parent 19ce569 commit 4b67fd5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions wnfs-common/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde::{
de::{DeserializeOwned, Error as DeError},
Deserialize, Deserializer, Serialize, Serializer,
};
use std::{collections::BTreeMap, convert::TryInto};
use std::{collections::BTreeMap, convert::TryInto, fmt::Display};

//--------------------------------------------------------------------------------------------------
// Type Definitions
Expand All @@ -24,17 +24,16 @@ pub enum NodeType {
SnapshotSharePointer,
}

impl ToString for NodeType {
fn to_string(&self) -> String {
match self {
impl Display for NodeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
NodeType::PublicFile => "wnfs/pub/file",
NodeType::PublicDirectory => "wnfs/pub/dir",
NodeType::PrivateFile => "wnfs/priv/file",
NodeType::PrivateDirectory => "wnfs/priv/dir",
NodeType::TemporalSharePointer => "wnfs/share/temporal",
NodeType::SnapshotSharePointer => "wnfs/share/snapshot",
}
.to_string()
})
}
}

Expand Down

0 comments on commit 4b67fd5

Please sign in to comment.