diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 1372151b75369..474a97bca8b69 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -331,6 +331,7 @@ impl Ord for Cell { #[stable(feature = "cell_from", since = "1.12.0")] impl From for Cell { + #[inline] fn from(t: T) -> Cell { Cell::new(t) } @@ -449,6 +450,7 @@ impl Cell { /// assert_eq!(cell.replace(10), 5); /// assert_eq!(cell.get(), 10); /// ``` + #[inline] #[stable(feature = "move_cell", since = "1.17.0")] pub fn replace(&self, val: T) -> T { mem::replace(unsafe { &mut *self.value.get() }, val) @@ -466,6 +468,7 @@ impl Cell { /// /// assert_eq!(five, 5); /// ``` + #[inline] #[stable(feature = "move_cell", since = "1.17.0")] pub fn into_inner(self) -> T { self.value.into_inner() @@ -486,6 +489,7 @@ impl Cell { /// assert_eq!(five, 5); /// assert_eq!(c.into_inner(), 0); /// ``` + #[inline] #[stable(feature = "move_cell", since = "1.17.0")] pub fn take(&self) -> T { self.replace(Default::default())