|
5 | 5 | //!
|
6 | 6 | //! ```
|
7 | 7 | //! use annotate_snippets::snippet::{Snippet, Slice, Annotation, TitleAnnotation, AnnotationType};
|
8 |
| -//! use annotate_snippets::display_list::{DisplayList, DisplayLine}; |
| 8 | +//! use annotate_snippets::display_list::{DisplayList, DisplayLine, DisplayAnnotationType}; |
9 | 9 | //!
|
10 | 10 | //! let snippet = Snippet {
|
11 | 11 | //! slice: Slice {
|
12 |
| -//! source: r#"id: Some()"#.to_string(), |
| 12 | +//! source: "id: Option<>,\nlabel: Option<String>".to_string(), |
13 | 13 | //! line_start: 145,
|
14 | 14 | //! origin: Some("src/display_list.rs".to_string())
|
15 | 15 | //! },
|
|
24 | 24 | //! Annotation {
|
25 | 25 | //! label: Some("expected 1 parameter".to_string()),
|
26 | 26 | //! annotation_type: AnnotationType::Error,
|
27 |
| -//! range: Some((19, 23)) |
| 27 | +//! range: Some((4, 12)) |
28 | 28 | //! }
|
29 | 29 | //! ]
|
30 | 30 | //! };
|
|
36 | 36 | //! DisplayLine::Source {
|
37 | 37 | //! lineno: 145,
|
38 | 38 | //! inline_marks: vec![],
|
39 |
| -//! content: "id: Some()".to_string() |
| 39 | +//! content: "id: Option<>,".to_string() |
| 40 | +//! }, |
| 41 | +//! DisplayLine::Annotation { |
| 42 | +//! label: "expected 1 parameter".to_string(), |
| 43 | +//! range: (4, 12), |
| 44 | +//! inline_marks: vec![], |
| 45 | +//! annotation_type: DisplayAnnotationType::Error, |
| 46 | +//! }, |
| 47 | +//! DisplayLine::Source { |
| 48 | +//! lineno: 146, |
| 49 | +//! inline_marks: vec![], |
| 50 | +//! content: "label: Option<String>".to_string() |
40 | 51 | //! },
|
41 | 52 | //! DisplayLine::EmptySource
|
42 | 53 | //! ]
|
|
0 commit comments