Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: use cargo readme to update #351

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ libraries and such might not want.
- [... in `main()`](#-in-main)
- [... diagnostic code URLs](#-diagnostic-code-urls)
- [... snippets](#-snippets)
- [... help text](#-help-text)
- [... severity level](#-severity-level)
- [... multiple related errors](#-multiple-related-errors)
- [... delayed source code](#-delayed-source-code)
- [... handler options](#-handler-options)
Expand Down
19 changes: 17 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
//! - [... in `main()`](#-in-main)
//! - [... diagnostic code URLs](#-diagnostic-code-urls)
//! - [... snippets](#-snippets)
//! - [... help text](#-help-text)
//! - [... severity level](#-severity-level)
//! - [... multiple related errors](#-multiple-related-errors)
//! - [... delayed source code](#-delayed-source-code)
//! - [... handler options](#-handler-options)
Expand Down Expand Up @@ -424,7 +426,7 @@
//! }
//! ```
//!
//! #### ... help text
//! ### ... help text
//! `miette` provides two facilities for supplying help text for your errors:
//!
//! The first is the `#[help()]` format attribute that applies to structs or
Expand Down Expand Up @@ -460,6 +462,19 @@
//! };
//! ```
//!
//! ### ... severity level
//! `miette` provides a way to set the severity level of a diagnostic.
//!
//! ```rust
//! use miette::Diagnostic;
//! use thiserror::Error;
//!
//! #[derive(Debug, Diagnostic, Error)]
//! #[error("welp")]
//! #[diagnostic(severity(Warning))]
//! struct Foo;
//! ```
//!
//! ### ... multiple related errors
//!
//! `miette` supports collecting multiple errors into a single diagnostic, and
Expand Down Expand Up @@ -636,7 +651,7 @@
//!
//! let source = "2 + 2 * 2 = 8".to_string();
//! let report = miette!(
//! labels = vec[
//! labels = vec![
//! LabeledSpan::at(12..13, "this should be 6"),
//! ],
//! help = "'*' has greater precedence than '+'",
Expand Down