show rendered cargo error in detail for clippy errors #2559
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sample clippy output:
{ "reason": "compiler-message", "package_id": "snow_white 0.1.0 (path+file:///Users/lazarus/dev/grim/snow_white)", "target": { "kind": [ "lib" ], "crate_types": [ "lib" ], "name": "snow_white", "src_path": "/Users/lazarus/dev/grim/snow_white/src/lib.rs", "edition": "2018", "doctest": true }, "message": { "rendered": "warning: You are using an explicit closure for copying elements\n --> snow_white/src/save.rs:289:21\n |\n289 | pending_seqs.seqs.iter().map(|seq| *seq).collect::<Vec<Seq>>()\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `pending_seqs.seqs.iter().copied()`\n |\n = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone\n\n", "children": [ { "children": [ ], "code": null, "level": "help", "message": "for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone", "rendered": null, "spans": [ ] }, { "children": [ ], "code": null, "level": "help", "message": "Consider calling the dedicated `copied` method", "rendered": null, "spans": [ { "byte_end": 11764, "byte_start": 11724, "column_end": 61, "column_start": 21, "expansion": null, "file_name": "snow_white/src/save.rs", "is_primary": true, "label": null, "line_end": 289, "line_start": 289, "suggested_replacement": "pending_seqs.seqs.iter().copied()", "suggestion_applicability": "MachineApplicable", "text": [ { "highlight_end": 61, "highlight_start": 21, "text": " pending_seqs.seqs.iter().map(|seq| *seq).collect::<Vec<Seq>>()" } ] } ] } ], "code": { "code": "clippy::map_clone", "explanation": null }, "level": "warning", "message": "You are using an explicit closure for copying elements", "spans": [ { "byte_end": 11764, "byte_start": 11724, "column_end": 61, "column_start": 21, "expansion": null, "file_name": "snow_white/src/save.rs", "is_primary": true, "label": null, "line_end": 289, "line_start": 289, "suggested_replacement": null, "suggestion_applicability": null, "text": [ { "highlight_end": 61, "highlight_start": 21, "text": " pending_seqs.seqs.iter().map(|seq| *seq).collect::<Vec<Seq>>()" } ] } ] } }The current detail is:
The new detail is: