Skip to content

Commit

Permalink
🧑 zv: manually implement Debug for OwnedObjectPath
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Jul 1, 2023
1 parent 41aaaef commit 38a30e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion zvariant/src/object_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ fn ensure_correct_object_path_str(path: &[u8]) -> Result<()> {
}

/// Owned [`ObjectPath`](struct.ObjectPath.html)
#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, serde::Serialize, Type)]
#[derive(Default, Clone, PartialEq, Eq, Hash, serde::Serialize, Type)]
pub struct OwnedObjectPath(ObjectPath<'static>);

assert_impl_all!(OwnedObjectPath: Send, Sync, Unpin);
Expand Down Expand Up @@ -378,6 +378,12 @@ impl std::fmt::Display for OwnedObjectPath {
}
}

impl Debug for OwnedObjectPath {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(self.as_str(), f)
}
}

#[cfg(test)]
mod unit {
use super::*;
Expand Down

0 comments on commit 38a30e7

Please sign in to comment.