Skip to content

Commit

Permalink
docs: update readme again
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jul 16, 2023
1 parent bfacb63 commit 10c3b7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ You can derive a `Diagnostic` from any `std::error::Error` type.
`thiserror` is a great way to define them, and plays nicely with `miette`!
*/
use miette::{Diagnostic, NamedSource, Result, SourceSpan};
use miette::{Diagnostic, SourceSpan};
use thiserror::Error;

#[derive(Error, Debug, Diagnostic)]
Expand All @@ -123,10 +123,12 @@ Use this `Result` type (or its expanded version) as the return type
throughout your app (but NOT your libraries! Those should always return
concrete types!).
*/
use miette::{NamedSource, Result};
fn this_fails() -> Result<()> {
// You can use plain strings as a `Source`, or anything that implements
// the one-method `Source` trait.
let src = "source\n text\n here".to_string();
let len = src.len();

Err(MyBad {
src: NamedSource::new("bad_file.rs", src),
Expand Down

0 comments on commit 10c3b7f

Please sign in to comment.