Skip to content

Commit

Permalink
Mark Option::insert as must_use
Browse files Browse the repository at this point in the history
  • Loading branch information
oxalica committed Jul 16, 2021
1 parent a6470c7 commit 774a79e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@ impl<T> Option<T> {
/// *val = 3;
/// assert_eq!(opt.unwrap(), 3);
/// ```
#[must_use = "if you intended to set a value, consider assignment instead"]
#[inline]
#[stable(feature = "option_insert", since = "1.53.0")]
pub fn insert(&mut self, value: T) -> &mut T {
Expand Down

0 comments on commit 774a79e

Please sign in to comment.