Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix no copy when cast Snippet to DisplayList and #29 #32

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

Merged
zbraniecki merged 2 commits into rust-lang:master from zzau13:master
Apr 4, 2020
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: 1 addition & 1 deletion Cargo.toml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ yansi-term = { version = "0.1", optional = true }

[dev-dependencies]
glob = "0.3"
serde_yaml = "0.8"
toml = "0.5"
serde = { version = "1.0", features = ["derive"] }
difference = "2.0"
yansi-term = "0.1"
Expand Down
13 changes: 6 additions & 7 deletions benches/simple.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,26 @@ fn create_snippet() {
}
_ => continue,
}
}"#
.to_string(),
}"#,
line_start: 51,
origin: Some("src/format.rs".to_string()),
origin: Some("src/format.rs"),
fold: false,
annotations: vec![
SourceAnnotation {
label: "expected `Option<String>` because of return type".to_string(),
label: "expected `Option<String>` because of return type",
annotation_type: AnnotationType::Warning,
range: (5, 19),
},
SourceAnnotation {
label: "expected enum `std::option::Option`".to_string(),
label: "expected enum `std::option::Option`",
annotation_type: AnnotationType::Error,
range: (26, 724),
},
],
}],
title: Some(Annotation {
label: Some("mismatched types".to_string()),
id: Some("E0308".to_string()),
label: Some("mismatched types"),
id: Some("E0308"),
annotation_type: AnnotationType::Error,
}),
footer: vec![],
Expand Down
13 changes: 6 additions & 7 deletions examples/expected_type.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@ use annotate_snippets::{
fn main() {
let snippet = Snippet {
title: Some(Annotation {
label: Some("expected type, found `22`".to_string()),
label: Some("expected type, found `22`"),
id: None,
annotation_type: AnnotationType::Error,
}),
footer: vec![],
slices: vec![Slice {
source: r#" annotations: vec![SourceAnnotation {
label: "expected struct `annotate_snippets::snippet::Slice`, found reference"
.to_string(),
range: <22, 25>,"#
.to_string(),
,
range: <22, 25>,"#,
line_start: 26,
origin: Some("examples/footer.rs".to_string()),
origin: Some("examples/footer.rs"),
fold: true,
annotations: vec![
SourceAnnotation {
label: "".to_string(),
label: "",
annotation_type: AnnotationType::Error,
range: (205, 207),
},
SourceAnnotation {
label: "while parsing this struct".to_string(),
label: "while parsing this struct",
annotation_type: AnnotationType::Info,
range: (34, 50),
},
Expand Down
14 changes: 6 additions & 8 deletions examples/footer.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@ use annotate_snippets::{
fn main() {
let snippet = Snippet {
title: Some(Annotation {
label: Some("mismatched types".to_string()),
id: Some("E0308".to_string()),
label: Some("mismatched types"),
id: Some("E0308"),
annotation_type: AnnotationType::Error,
}),
footer: vec![Annotation {
label: Some(
"expected type: `snippet::Annotation`\n found type: `__&__snippet::Annotation`"
.to_string(),
"expected type: `snippet::Annotation`\n found type: `__&__snippet::Annotation`",
),
id: None,
annotation_type: AnnotationType::Note,
}],
slices: vec![Slice {
source: " slices: vec![\"A\",".to_string(),
source: " slices: vec![\"A\",",
line_start: 13,
origin: Some("src/multislice.rs".to_string()),
origin: Some("src/multislice.rs"),
fold: false,
annotations: vec![SourceAnnotation {
label: "expected struct `annotate_snippets::snippet::Slice`, found reference"
.to_string(),
label: "expected struct `annotate_snippets::snippet::Slice`, found reference",
range: (21, 24),
annotation_type: AnnotationType::Error,
}],
Expand Down
13 changes: 6 additions & 7 deletions examples/format.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,26 @@ fn main() {
}
_ => continue,
}
}"#
.to_string(),
}"#,
line_start: 51,
origin: Some("src/format.rs".to_string()),
origin: Some("src/format.rs"),
fold: false,
annotations: vec![
SourceAnnotation {
label: "expected `Option<String>` because of return type".to_string(),
label: "expected `Option<String>` because of return type",
annotation_type: AnnotationType::Warning,
range: (5, 19),
},
SourceAnnotation {
label: "expected enum `std::option::Option`".to_string(),
label: "expected enum `std::option::Option`",
annotation_type: AnnotationType::Error,
range: (26, 724),
},
],
}],
title: Some(Annotation {
label: Some("mismatched types".to_string()),
id: Some("E0308".to_string()),
label: Some("mismatched types"),
id: Some("E0308"),
annotation_type: AnnotationType::Error,
}),
footer: vec![],
Expand Down
10 changes: 5 additions & 5 deletions examples/multislice.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ use annotate_snippets::{
fn main() {
let snippet = Snippet {
title: Some(Annotation {
label: Some("mismatched types".to_string()),
label: Some("mismatched types"),
id: None,
annotation_type: AnnotationType::Error,
}),
footer: vec![],
slices: vec![
Slice {
source: "Foo".to_string(),
source: "Foo",
line_start: 51,
origin: Some("src/format.rs".to_string()),
origin: Some("src/format.rs"),
fold: false,
annotations: vec![],
},
Slice {
source: "Faa".to_string(),
source: "Faa",
line_start: 129,
origin: Some("src/display.rs".to_string()),
origin: Some("src/display.rs"),
fold: false,
annotations: vec![],
},
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /