mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.
This commit is contained in:
parent
65d4b12bf2
commit
5f15eb5fbf
140 changed files with 1420 additions and 1222 deletions
|
@ -4,14 +4,14 @@
|
|||
|
||||
//! Utility functions for doubly-linked lists.
|
||||
|
||||
use std::collections::DList;
|
||||
use std::collections::LinkedList;
|
||||
use std::mem;
|
||||
|
||||
/// Splits the head off a list in O(1) time, and returns the head.
|
||||
pub fn split_off_head<T>(list: &mut DList<T>) -> DList<T> {
|
||||
pub fn split_off_head<T>(list: &mut LinkedList<T>) -> LinkedList<T> {
|
||||
// FIXME: Work around https://github.com/rust-lang/rust/issues/22244
|
||||
if list.len() == 1 {
|
||||
return mem::replace(list, DList::new());
|
||||
return mem::replace(list, LinkedList::new());
|
||||
}
|
||||
let tail = list.split_off(1);
|
||||
mem::replace(list, tail)
|
||||
|
@ -19,7 +19,7 @@ pub fn split_off_head<T>(list: &mut DList<T>) -> DList<T> {
|
|||
|
||||
/// Prepends the items in the other list to this one, leaving the other list empty.
|
||||
#[inline]
|
||||
pub fn prepend_from<T>(this: &mut DList<T>, other: &mut DList<T>) {
|
||||
pub fn prepend_from<T>(this: &mut LinkedList<T>, other: &mut LinkedList<T>) {
|
||||
other.append(this);
|
||||
mem::swap(this, other);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue