3 NotFound { key: Vec<u8> },
7 impl std::error::Error for MyError {}
9 impl std::fmt::Display for MyError {
10 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12 MyError::NotFound { key } => write!(
14 "unknown error with code {}.",
15 String::from_utf8(*key).unwrap()
16 //~^ ERROR cannot move out of `*key` which is behind a shared reference
18 MyError::Err41 => write!(f, "Sit by a lake"),
23 println!("Hello, world!");