docs: update readme oops

This commit is contained in:
Kat Marchán 2021-08-17 09:05:53 -07:00
parent f79aee63b1
commit b7deb2d002
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 4 additions and 6 deletions

View File

@ -63,11 +63,10 @@ use thiserror::Error;
)]
struct MyBad {
src: Arc<String>,
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(),
})
}
```