Skip to content

Commit d37ada8

Browse files
authoredOct 23, 2023
docs(README): Move import of NamedResult to where it is used (#309)
An example in README.md makes use of `miette::NamedResult` . It is imported in the second "example-step", but already used in the first one. Beginners, that copy the example step-by-step to understand it, will run into compile errors, as `NamedResult` was not imported.
1 parent 88d00e0 commit d37ada8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ You can derive a `Diagnostic` from any `std::error::Error` type.
9696
9797
`thiserror` is a great way to define them, and plays nicely with `miette`!
9898
*/
99-
use miette::{Diagnostic, SourceSpan};
99+
use miette::{Diagnostic, NamedSource, SourceSpan};
100100
use thiserror::Error;
101101

102102
#[derive(Error, Debug, Diagnostic)]
@@ -123,7 +123,7 @@ Use this `Result` type (or its expanded version) as the return type
123123
throughout your app (but NOT your libraries! Those should always return
124124
concrete types!).
125125
*/
126-
use miette::{NamedSource, Result};
126+
use miette::Result;
127127
fn this_fails() -> Result<()> {
128128
// You can use plain strings as a `Source`, or anything that implements
129129
// the one-method `Source` trait.

0 commit comments

Comments
 (0)
Please sign in to comment.