Skip to content

Commit

Permalink
Auto merge of rust-lang#102548 - nikic:inline-cell-replace, r=scottmcm
Browse files Browse the repository at this point in the history
Mark Cell::replace() as #[inline]

Giving this a try based on rust-lang#102539 (comment).
  • Loading branch information
bors committed Oct 2, 2022
2 parents c2590e6 + 49eaa0f commit 756e7be
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 756e7be

Please sign in to comment.