1
Fork 0

Make Option::as_mut const

This commit is contained in:
woppopo 2021-10-17 00:02:42 +09:00
parent 7fbd4ce276
commit 00dba3a693
2 changed files with 10 additions and 1 deletions

View file

@ -380,6 +380,14 @@ const fn option_const_mut() {
let _take = option.take();
let _replace = option.replace(42);
{
let as_mut = option.as_mut();
match as_mut {
Some(v) => *v = 32,
None => unreachable!(),
}
}
}
#[test]