Skip to content

Commit eb0d16d

Browse files
committed
docs: Provide an example for Level::title
1 parent 683bea7 commit eb0d16d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/level.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ impl<'a> Level<'a> {
6464
/// not allowed to be passed to this function.
6565
///
6666
/// </div>
67+
///
68+
/// # Example
69+
///
70+
/// ```rust
71+
/// # use annotate_snippets::{Group, Snippet, AnnotationKind, Level};
72+
/// let input = &[
73+
/// Group::with_title(Level::ERROR.title("mismatched types").id("E0308"))
74+
/// ];
75+
/// ```
6776
pub fn title(self, text: impl Into<Cow<'a, str>>) -> Title<'a> {
6877
Title {
6978
level: self,

0 commit comments

Comments
 (0)