We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Option::insert
1 parent a6470c7 commit 774a79eCopy full SHA for 774a79e
library/core/src/option.rs
@@ -1179,6 +1179,7 @@ impl<T> Option<T> {
1179
/// *val = 3;
1180
/// assert_eq!(opt.unwrap(), 3);
1181
/// ```
1182
+ #[must_use = "if you intended to set a value, consider assignment instead"]
1183
#[inline]
1184
#[stable(feature = "option_insert", since = "1.53.0")]
1185
pub fn insert(&mut self, value: T) -> &mut T {
0 commit comments