If you are only using it in one function, put the use
statement in that function.
This improves locality, making it easier to read and move the code.
When importing a trait
to use it's trait methods, do this: use Trait as _;
.
That lets the reader know why you imported it, even though it seems unused.
Prefer anyhow::Result<_>
over Result<_, anyhow::Error>
;
Don't do use anyhow::Result;
- be explicit.