diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-22 22:14:38 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-22 22:14:38 +0100 |
commit | 27694abd9473c53cee4549dfe5ef5d28d0c01bed (patch) | |
tree | 6f51587dc28fc8fe28c0971a810541421ea2d829 /crates/tools/src | |
parent | 5a64b9a811554473e65db7e7ae515079ca48c70b (diff) | |
parent | dc9ce8ff7494f641c7102785cdef95489f2fc3d6 (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/tools/src')
-rw-r--r-- | crates/tools/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/tools/src/main.rs | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 444745be5..7c5410d3c 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs | |||
@@ -50,7 +50,7 @@ pub fn collect_tests(s: &str) -> Vec<(usize, Test)> { | |||
50 | block.map(|(_, line)| line).chain(::std::iter::once("")), | 50 | block.map(|(_, line)| line).chain(::std::iter::once("")), |
51 | "\n", | 51 | "\n", |
52 | ); | 52 | ); |
53 | assert!(!text.trim().is_empty() && text.ends_with("\n")); | 53 | assert!(!text.trim().is_empty() && text.ends_with('\n')); |
54 | res.push((start_line, Test { name, text })) | 54 | res.push((start_line, Test { name, text })) |
55 | } | 55 | } |
56 | res | 56 | res |
diff --git a/crates/tools/src/main.rs b/crates/tools/src/main.rs index 152298014..fdb443690 100644 --- a/crates/tools/src/main.rs +++ b/crates/tools/src/main.rs | |||
@@ -112,9 +112,8 @@ fn existing_tests(dir: &Path) -> Result<HashMap<String, (PathBuf, Test)>> { | |||
112 | name: name.clone(), | 112 | name: name.clone(), |
113 | text, | 113 | text, |
114 | }; | 114 | }; |
115 | match res.insert(name, (path, test)) { | 115 | if let Some(old) = res.insert(name, (path, test)) { |
116 | Some(old) => println!("Duplicate test: {:?}", old), | 116 | println!("Duplicate test: {:?}", old); |
117 | None => (), | ||
118 | } | 117 | } |
119 | } | 118 | } |
120 | Ok(res) | 119 | Ok(res) |