From 89806755a4d89e2dc15bfd1d94f6b758df205571 Mon Sep 17 00:00:00 2001 From: 0x009922 Date: Thu, 29 Jun 2023 08:42:12 +0700 Subject: [PATCH] docs: a little cleaning in README (#274) --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 61fcf50..8375876 100644 --- a/README.md +++ b/README.md @@ -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, SourceSpan}; +use miette::{Diagnostic, NamedSource, Result, SourceSpan}; use thiserror::Error; #[derive(Error, Debug, Diagnostic)] @@ -123,12 +123,10 @@ 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),