1
Fork 0

Make debug builders take &mut self, add entries method

[breaking-change]
This commit is contained in:
Steven Fackler 2015-05-17 13:17:26 -07:00
parent 8b7c17db22
commit bd85983d05
9 changed files with 64 additions and 33 deletions

View file

@ -408,12 +408,13 @@ impl fmt::Debug for File {
}
let fd = self.0.raw();
let mut b = f.debug_struct("File").field("fd", &fd);
let mut b = f.debug_struct("File");
b.field("fd", &fd);
if let Some(path) = get_path(fd) {
b = b.field("path", &path);
b.field("path", &path);
}
if let Some((read, write)) = get_mode(fd) {
b = b.field("read", &read).field("write", &write);
b.field("read", &read).field("write", &write);
}
b.finish()
}