2020-03-12 15:24:20 +01:00
[
MappedRustDiagnostic {
2020-07-09 15:35:52 +02:00
url: "file:///test/src/main.rs",
2020-03-12 15:24:20 +01:00
diagnostic: Diagnostic {
range: Range {
start: Position {
line: 3,
character: 4,
},
end: Position {
line: 3,
character: 5,
},
2020-03-12 15:01:53 +01:00
},
2020-03-12 15:24:20 +01:00
severity: Some(
Warning,
2020-03-12 15:01:53 +01:00
),
2020-03-12 15:24:20 +01: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 15:01:53 +01:00
},
},
2020-03-12 15:24:20 +01:00
message: "unnecessary let binding",
2020-03-12 15:01:53 +01:00
},
2020-03-12 15:24:20 +01:00
],
2020-03-12 15:01:53 +01:00
),
2020-03-12 15:24:20 +01:00
tags: None,
},
fixes: [
CodeAction {
title: "return the expression directly",
2020-06-02 22:21:48 +02:00
id: None,
2020-05-22 17:29:55 +02:00
group: None,
2020-03-12 15:24:20 +01:00
kind: Some(
"quickfix",
),
2020-05-18 00:11:40 +02:00
command: None,
2020-03-12 15:24:20 +01:00
edit: Some(
2020-05-18 00:11:40 +02:00
SnippetWorkspaceEdit {
2020-03-12 15:24:20 +01: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 15:01:53 +01:00
},
2020-03-12 15:24:20 +01:00
new_text: "",
2020-03-12 15:01:53 +01:00
},
2020-03-12 15:24:20 +01:00
TextEdit {
range: Range {
start: Position {
line: 3,
character: 4,
},
end: Position {
line: 3,
character: 5,
},
2020-03-12 15:01:53 +01:00
},
2020-03-12 15:24:20 +01:00
new_text: "(0..10).collect()",
2020-03-12 15:01:53 +01:00
},
2020-03-12 15:24:20 +01:00
],
},
),
document_changes: None,
},
),
},
],
},
]