precommit test

This commit is contained in:
klensy 2025-06-17 17:21:46 +03:00
parent 7c828e63ba
commit dc3b8bef80
2 changed files with 36 additions and 0 deletions

View file

@ -439,4 +439,22 @@ fn test_option_get_or_insert() {
//~^ or_fun_call
}
fn test_option_and() {
// assume that this is slow call
fn g() -> Option<u8> {
Some(99)
}
let mut x = Some(42_u8);
let _ = x.and(g());
}
fn test_result_and() {
// assume that this is slow call
fn g() -> Result<u8, ()> {
Ok(99)
}
let mut x: Result<u8, ()> = Ok(42);
let _ = x.and(g());
}
fn main() {}

View file

@ -439,4 +439,22 @@ fn test_option_get_or_insert() {
//~^ or_fun_call
}
fn test_option_and() {
// assume that this is slow call
fn g() -> Option<u8> {
Some(99)
}
let mut x = Some(42_u8);
let _ = x.and(g());
}
fn test_result_and() {
// assume that this is slow call
fn g() -> Result<u8, ()> {
Ok(99)
}
let mut x: Result<u8, ()> = Ok(42);
let _ = x.and(g());
}
fn main() {}