rustc/vendor/anyhow-1.0.95/tests/common/mod.rs
2025-02-17 11:14:05 +01:00

15 lines
271 B
Rust

use anyhow::{bail, Result};
use std::io;
pub fn bail_literal() -> Result<()> {
bail!("oh no!");
}
pub fn bail_fmt() -> Result<()> {
bail!("{} {}!", "oh", "no");
}
pub fn bail_error() -> Result<()> {
bail!(io::Error::new(io::ErrorKind::Other, "oh no!"));
}