cleanup: replace as[_mut]_slice() calls with deref coercions

This commit is contained in:
Jorge Aparicio
2015-02-01 21:53:25 -05:00
parent 2c05354211
commit 17bc7d8d5b
289 changed files with 1372 additions and 1406 deletions

View File

@@ -145,8 +145,7 @@ impl TocBuilder {
(0, &self.top_level)
}
Some(entry) => {
sec_number = String::from_str(entry.sec_number
.as_slice());
sec_number = String::from_str(&entry.sec_number);
sec_number.push_str(".");
(entry.level, &entry.children)
}
@@ -158,7 +157,7 @@ impl TocBuilder {
sec_number.push_str("0.");
}
let number = toc.count_entries_with_level(level);
sec_number.push_str(format!("{}", number + 1).as_slice())
sec_number.push_str(&format!("{}", number + 1))
}
self.chain.push(TocEntry {
@@ -172,7 +171,7 @@ impl TocBuilder {
// get the thing we just pushed, so we can borrow the string
// out of it with the right lifetime
let just_inserted = self.chain.last_mut().unwrap();
just_inserted.sec_number.as_slice()
&just_inserted.sec_number
}
}