const CAT_FOUND: bool = true;
fn main() {
let result = pet_cat();
if result.is_ok() {
println!("Great, we could pet the cat!");
} else {
println!("Oh no, we couldn't pet the cat!");
}
}
fn pet_cat() -> Result<(), String> {
if CAT_FOUND {
Ok(())
} else {
Err(String::from("the cat is nowhere to be found"))
}
}