1 use anyhow::{bail, Result}; 2 use std::io; 3 bail_literal() -> Result<()>4pub fn bail_literal() -> Result<()> { 5 bail!("oh no!"); 6 } 7 bail_fmt() -> Result<()>8pub fn bail_fmt() -> Result<()> { 9 bail!("{} {}!", "oh", "no"); 10 } 11 bail_error() -> Result<()>12pub fn bail_error() -> Result<()> { 13 bail!(io::Error::new(io::ErrorKind::Other, "oh no!")); 14 } 15