]> git.lizzy.rs Git - rust.git/blobdiff - library/alloc/src/collections/linked_list.rs
Use Box::new() instead of box syntax in alloc tests
[rust.git] / library / alloc / src / collections / linked_list.rs
index 67dc4f30f3179c9d6681f900443cf224f2ac8f5a..e21c8aa3bd536d1fa4ecfda330f82df66f8985e1 100644 (file)
@@ -791,7 +791,7 @@ pub fn back_mut(&mut self) -> Option<&mut T> {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn push_front(&mut self, elt: T) {
-        self.push_front_node(box Node::new(elt));
+        self.push_front_node(Box::new(Node::new(elt)));
     }
 
     /// Removes the first element and returns it, or `None` if the list is
@@ -834,7 +834,7 @@ pub fn pop_front(&mut self) -> Option<T> {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn push_back(&mut self, elt: T) {
-        self.push_back_node(box Node::new(elt));
+        self.push_back_node(Box::new(Node::new(elt)));
     }
 
     /// Removes the last element from a list and returns it, or `None` if