anyhow_ext 0.2.1
References a public code-forge URLReads a file into a Rust string
SHA-256a135cb522bf5b2254ed712979bc242f60c13f7906c1e4585d5fef36ae9017528
MaleculeH₂(CmF)
Evidence
1use anyhow_ext::{Context, Result};
2
3fn foo() -> Result<()> {
4 std::fs::read_to_string("file_not_exists.txt").dot()?;
5 Ok(())
6}
⋯8 lines
1# anyhow_ext
2
3An extension of [anyhow](https://github.com/dtolnay/anyhow). A drop-in replacement of anyhow.
4
5# Features
⋯4 lines
10# usage
11
12## Work with anyhow!
13
14```toml
⋯5 lines
31:21… nt of anyhow
32
33Since `anyhow_ext` re-exports all the thing in `anyhow` except for `Context`, you can use anyhow_ext as a drop-in replacement.
34
35`Cargo.toml`
36```toml
37[dependencies …
54:7… in
55foo err at `src/bin/anyhow_ext.rs@6:11`
56```
57
58and `println!("{:?}", err)` looks like
59
60```plain
61 foo err at `src/bin/anyhow_ext.rs@6:11`
62
63 Cause …
90:18… Result<()> {
91 bar().dot()?;
92 Ok(())
93}
94```
95This will make a small backtrace.
96
97```text
⋯4 lines
No evidence locations were recorded for this file. Raw result