Skip to content

Commit

Permalink
Mark Cell::replace() as #[inline]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Oct 1, 2022
1 parent 744e397 commit 49eaa0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ impl<T> Cell<T> {
/// 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 {
// SAFETY: This can cause data races if called from a separate thread,
Expand Down

0 comments on commit 49eaa0f

Please sign in to comment.