Skip to content

Commit a3f9ba3

Browse files
committed
Switch annotations to be a slice
1 parent 52b874c commit a3f9ba3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

benches/simple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn create_snippet() {
4646
source: SOURCE,
4747
line_start: Some(51),
4848
origin: Some("src/format.rs"),
49-
annotations: vec![
49+
annotations: &[
5050
SourceAnnotation {
5151
label: "expected `Option<String>` because of return type",
5252
annotation_type: AnnotationType::Warning,

examples/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() {
4040
source,
4141
line_start: Some(51),
4242
origin: Some("src/format.rs"),
43-
annotations: vec![
43+
annotations: &[
4444
SourceAnnotation {
4545
label: "expected `Option<String>` because of return type",
4646
annotation_type: AnnotationType::Warning,

src/slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ pub struct Slice<'s> {
55
pub source: &'s str,
66
pub line_start: Option<usize>,
77
pub origin: Option<&'s str>,
8-
pub annotations: Vec<SourceAnnotation<'s>>,
8+
pub annotations: &'s [SourceAnnotation<'s>],
99
}

0 commit comments

Comments
 (0)