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 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",