Fix error with borrowing packed fields

This commit is contained in:
Jeremy Soller
2017-12-06 20:12:02 -07:00
parent eac37c7dc5
commit f206dab653
3 changed files with 31 additions and 25 deletions
+7 -5
View File
@@ -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()
}
}
}