rusty-man/tests/snapshots/output__1.53.0_html_macro_anyhow_anyhow.snap
Robin Krahl 68f20c8d8c
Add support and tests for Rust 1.53.0
This patch adds tests for Rust 1.53.0 and adapts the HTML parser to
handle method and implementations list inside of details elements.
2021-06-18 17:17:33 +02:00

31 lines
858 B
Plaintext

---
source: tests/output.rs
expression: "get_stdout(&[item])"
---
anyhow Macro anyhow::anyhow rusty-man
SYNOPSIS
macro_rules! anyhow {
($msg:literal $(,)?) => { ... };
($err:expr $(,)?) => { ... };
($fmt:expr, $($arg:tt)*) => { ... };
}
DESCRIPTION
Construct an ad-hoc error from a string.
This evaluates to an `Error`. It can take either just a string, or a format string with
arguments. It also can take any custom type which implements `Debug` and `Display`.
# Example
use anyhow::{anyhow, Result};
fn lookup(key: &str) -> Result<V> {
if key.len() != 16 {
return Err(anyhow!("key length must be 16 characters, got {:?}", key));
}
// ...
}