mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Revert "Make DOMRefCell use style’s copy of RefCell"
This reverts commit ec723057b2
.
This commit is contained in:
parent
c831369e3e
commit
fbde392c3d
12 changed files with 10 additions and 35 deletions
|
@ -15,7 +15,6 @@
|
|||
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
#[cfg(feature = "servo")] use heapsize::HeapSizeOf;
|
||||
use std::cell::{UnsafeCell, Cell};
|
||||
use std::cmp::Ordering;
|
||||
use std::fmt::{self, Debug, Display};
|
||||
|
@ -32,13 +31,6 @@ pub struct RefCell<T: ?Sized> {
|
|||
value: UnsafeCell<T>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
impl<T: HeapSizeOf> HeapSizeOf for RefCell<T> {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
self.borrow().heap_size_of_children()
|
||||
}
|
||||
}
|
||||
|
||||
/// An enumeration of values returned from the `state` method on a `RefCell<T>`.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
pub enum BorrowState {
|
||||
|
@ -535,18 +527,6 @@ impl<'b, T: ?Sized> Ref<'b, T> {
|
|||
borrow: orig.borrow,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn filter_map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Option<Ref<'b, U>>
|
||||
where F: FnOnce(&T) -> Option<&U>
|
||||
{
|
||||
f(orig.value).map(move |new_value| {
|
||||
Ref {
|
||||
value: new_value,
|
||||
borrow: orig.borrow,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<'b, T: ?Sized> RefMut<'b, T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue