Commit f206dab6 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix error with borrowing packed fields

parent eac37c7d
......@@ -28,11 +28,13 @@ impl ExNode {
impl fmt::Debug for ExNode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let extents: Vec<&Extent> = self.extents.iter().filter(|extent| -> bool { extent.length > 0 }).collect();
f.debug_struct("ExNode")
.field("prev", &self.prev)
.field("next", &self.next)
.field("extents", &extents)
.finish()
unsafe {
f.debug_struct("ExNode")
.field("prev", &self.prev)
.field("next", &self.next)
.field("extents", &extents)
.finish()
}
}
}
......
......@@ -57,14 +57,16 @@ impl Header {
impl fmt::Debug for Header {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Header")
.field("signature", &self.signature)
.field("version", &self.version)
.field("uuid", &self.uuid)
.field("size", &self.size)
.field("root", &self.root)
.field("free", &self.free)
.finish()
unsafe {
f.debug_struct("Header")
.field("signature", &self.signature)
.field("version", &self.version)
.field("uuid", &self.uuid)
.field("size", &self.size)
.field("root", &self.root)
.field("free", &self.free)
.finish()
}
}
}
......
......@@ -114,18 +114,20 @@ impl Node {
impl fmt::Debug for Node {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let extents: Vec<&Extent> = self.extents.iter().filter(|extent| -> bool { extent.length > 0 }).collect();
f.debug_struct("Node")
.field("mode", &self.mode)
.field("uid", &self.uid)
.field("gid", &self.gid)
.field("ctime", &self.ctime)
.field("ctime_nsec", &self.ctime_nsec)
.field("mtime", &self.mtime)
.field("mtime_nsec", &self.mtime_nsec)
.field("name", &self.name())
.field("next", &self.next)
.field("extents", &extents)
.finish()
unsafe {
f.debug_struct("Node")
.field("mode", &self.mode)
.field("uid", &self.uid)
.field("gid", &self.gid)
.field("ctime", &self.ctime)
.field("ctime_nsec", &self.ctime_nsec)
.field("mtime", &self.mtime)
.field("mtime_nsec", &self.mtime_nsec)
.field("name", &self.name())
.field("next", &self.next)
.field("extents", &extents)
.finish()
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment