Mark Option::insert as must_use
This commit is contained in:
parent
a6470c7fa8
commit
774a79e3fd
1 changed files with 1 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue