From b7deb2d0022e22cefe161596be6635fb16abc03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 17 Aug 2021 09:05:53 -0700 Subject: [PATCH] docs: update readme oops --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a52267e..59ff88b 100644 --- a/README.md +++ b/README.md @@ -63,11 +63,10 @@ use thiserror::Error; )] struct MyBad { src: Arc, - filename: String, // Snippets and highlights can be included in the diagnostic! - #[snippet(src, filename, "This is the part that broke")] + #[snippet(src, "This is the part that broke")] snip: SourceSpan, - #[highlight(snip, "this bit here")] + #[highlight(snip)] bad_bit: SourceSpan, } @@ -103,9 +102,8 @@ fn pretend_this_is_main() -> Result<(), MyBad> { Err(MyBad { src: Arc::new(src), - filename: "bad_file.rs".into(), - snip: (0, len).into(), - bad_bit: (9, 3).into(), + snip: ("bad_file.rs", 0, len).into(), + bad_bit: ("this bit here", 9, 3).into(), }) } ```