mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix deprecation warnings
This commit is contained in:
parent
903a608c6a
commit
a3c0366bd6
7 changed files with 15 additions and 15 deletions
|
@ -249,14 +249,15 @@ impl ReportsForest {
|
|||
|
||||
// Insert the path and size into the forest, adding any trees and nodes as necessary.
|
||||
fn insert(&mut self, path: &[String], size: usize) {
|
||||
let (head, tail) = path.split_first().unwrap();
|
||||
// Get the right tree, creating it if necessary.
|
||||
if !self.trees.contains_key(&path[0]) {
|
||||
self.trees.insert(path[0].clone(), ReportsTree::new(path[0].clone()));
|
||||
if !self.trees.contains_key(head) {
|
||||
self.trees.insert(head.clone(), ReportsTree::new(head.clone()));
|
||||
}
|
||||
let t = self.trees.get_mut(&path[0]).unwrap();
|
||||
let t = self.trees.get_mut(head).unwrap();
|
||||
|
||||
// Use tail() because the 0th path segment was used to find the right tree in the forest.
|
||||
t.insert(path.tail(), size);
|
||||
// Use tail because the 0th path segment was used to find the right tree in the forest.
|
||||
t.insert(tail, size);
|
||||
}
|
||||
|
||||
fn print(&mut self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue