This commit is contained in:
Yukio Tanaka 2021-03-16 19:56:47 +09:00
parent c5b3a719ed
commit aa5f1f9078
No known key found for this signature in database
GPG Key ID: 5E16D7B6C674DCE6
2 changed files with 4 additions and 4 deletions

View File

@ -137,14 +137,14 @@ fn result_unwrap_or() {
}
// don't lint in const fn
const fn const_fn_unwrap_or() {
const fn const_fn_option_unwrap_or() {
match Some(1) {
Some(s) => s,
None => 0,
};
}
const fn const_fn_unwrap() {
const fn const_fn_result_unwrap_or() {
match Ok::<&str, &str>("Alice") {
Ok(s) => s,
Err(_) => "Bob",

View File

@ -176,14 +176,14 @@ fn method(self) -> Option<i32> {
}
// don't lint in const fn
const fn const_fn_unwrap_or() {
const fn const_fn_option_unwrap_or() {
match Some(1) {
Some(s) => s,
None => 0,
};
}
const fn const_fn_unwrap() {
const fn const_fn_result_unwrap_or() {
match Ok::<&str, &str>("Alice") {
Ok(s) => s,
Err(_) => "Bob",