2020-03-12 09:24:20 -05:00
[
MappedRustDiagnostic {
2020-07-09 08:35:52 -05:00
url: "file:///test/src/main.rs",
2020-03-12 09:24:20 -05:00
diagnostic: Diagnostic {
range: Range {
start: Position {
line: 3,
character: 4,
},
end: Position {
line: 3,
character: 5,
},
2020-03-12 09:01:53 -05:00
},
2020-03-12 09:24:20 -05:00
severity: Some(
Warning,
2020-03-12 09:01:53 -05:00
),
2020-03-12 09:24:20 -05:00
code: Some(
String(
"let_and_return",
),
),
source: Some(
"clippy",
),
message: "returning the result of a let binding from a block\n`#[warn(clippy::let_and_return)]` on by default\nfor further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return",
related_information: Some(
[
DiagnosticRelatedInformation {
location: Location {
uri: "file:///test/src/main.rs",
range: Range {
start: Position {
line: 2,
character: 4,
},
end: Position {
line: 2,
character: 30,
},
2020-03-12 09:01:53 -05:00
},
},
2020-03-12 09:24:20 -05:00
message: "unnecessary let binding",
2020-03-12 09:01:53 -05:00
},
2020-03-12 09:24:20 -05:00
],
2020-03-12 09:01:53 -05:00
),
2020-03-12 09:24:20 -05:00
tags: None,
},
fixes: [
CodeAction {
title: "return the expression directly",
2020-06-02 15:21:48 -05:00
id: None,
2020-05-22 10:29:55 -05:00
group: None,
2020-03-12 09:24:20 -05:00
kind: Some(
"quickfix",
),
2020-05-17 17:11:40 -05:00
command: None,
2020-03-12 09:24:20 -05:00
edit: Some(
2020-05-17 17:11:40 -05:00
SnippetWorkspaceEdit {
2020-03-12 09:24:20 -05:00
changes: Some(
{
"file:///test/src/main.rs": [
TextEdit {
range: Range {
start: Position {
line: 2,
character: 4,
},
end: Position {
line: 2,
character: 30,
},
2020-03-12 09:01:53 -05:00
},
2020-03-12 09:24:20 -05:00
new_text: "",
2020-03-12 09:01:53 -05:00
},
2020-03-12 09:24:20 -05:00
TextEdit {
range: Range {
start: Position {
line: 3,
character: 4,
},
end: Position {
line: 3,
character: 5,
},
2020-03-12 09:01:53 -05:00
},
2020-03-12 09:24:20 -05:00
new_text: "(0..10).collect()",
2020-03-12 09:01:53 -05:00
},
2020-03-12 09:24:20 -05:00
],
},
),
document_changes: None,
},
),
},
],
},
]