aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/utils.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-10-22 22:14:38 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-10-22 22:14:38 +0100
commit27694abd9473c53cee4549dfe5ef5d28d0c01bed (patch)
tree6f51587dc28fc8fe28c0971a810541421ea2d829 /crates/ra_syntax/src/utils.rs
parent5a64b9a811554473e65db7e7ae515079ca48c70b (diff)
parentdc9ce8ff7494f641c7102785cdef95489f2fc3d6 (diff)
Merge #138
138: Fix some clippy lints r=matklad a=alanhdu I went ahead and fixed all the clippy lints (there were a couple I thought would be better unfixed and added `cfg` statements to allow them) and also re-enabled clippy and rustfmt in CI. They were disabled with `no time to explain, disable clippy checks`, so hopefully this won't go against whatever the reason at the time was :laughing:. One question about the CI though: right now, it's an allowed failure that runs against the latest nightly each time. Would it be better to pin it to a specific nightly (or use the `beta` versions) to lower the churn? Co-authored-by: Alan Du <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/utils.rs')
-rw-r--r--crates/ra_syntax/src/utils.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/utils.rs b/crates/ra_syntax/src/utils.rs
index 7d0ef2fa2..8ee02724d 100644
--- a/crates/ra_syntax/src/utils.rs
+++ b/crates/ra_syntax/src/utils.rs
@@ -5,7 +5,7 @@ use std::fmt::Write;
5 5
6/// Parse a file and create a string representation of the resulting parse tree. 6/// Parse a file and create a string representation of the resulting parse tree.
7pub fn dump_tree(syntax: SyntaxNodeRef) -> String { 7pub fn dump_tree(syntax: SyntaxNodeRef) -> String {
8 let mut errors: Vec<_> = syntax.root_data().iter().cloned().collect(); 8 let mut errors: Vec<_> = syntax.root_data().to_vec();
9 errors.sort_by_key(|e| e.offset); 9 errors.sort_by_key(|e| e.offset);
10 let mut err_pos = 0; 10 let mut err_pos = 0;
11 let mut level = 0; 11 let mut level = 0;
@@ -42,7 +42,7 @@ pub fn dump_tree(syntax: SyntaxNodeRef) -> String {
42 writeln!(buf, "err: `{}`", err.msg).unwrap(); 42 writeln!(buf, "err: `{}`", err.msg).unwrap();
43 } 43 }
44 44
45 return buf; 45 buf
46} 46}
47 47
48pub fn check_fuzz_invariants(text: &str) { 48pub fn check_fuzz_invariants(text: &str) {