aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-10-30 17:36:37 +0000
committerkjeremy <[email protected]>2019-10-30 17:36:37 +0000
commitb441b4e8effeaf4532fd2e45c4d864480857c49e (patch)
tree5f25f7478b8ec365b2a2d5f7bea4ec2386bdd244 /xtask/src/codegen
parent5806195bc1cdb1ca3fa257e99fd6e0dd897713a9 (diff)
Some clippy fixes
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r--xtask/src/codegen/gen_assists_docs.rs2
-rw-r--r--xtask/src/codegen/gen_parser_tests.rs8
2 files changed, 4 insertions, 6 deletions
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs
index 0c4cf2152..05afda8f1 100644
--- a/xtask/src/codegen/gen_assists_docs.rs
+++ b/xtask/src/codegen/gen_assists_docs.rs
@@ -53,7 +53,7 @@ fn collect_assists() -> Result<Vec<Assist>> {
53 53
54 let doc = take_until(lines.by_ref(), "```").trim().to_string(); 54 let doc = take_until(lines.by_ref(), "```").trim().to_string();
55 assert!( 55 assert!(
56 doc.chars().next().unwrap().is_ascii_uppercase() && doc.ends_with("."), 56 doc.chars().next().unwrap().is_ascii_uppercase() && doc.ends_with('.'),
57 "\n\n{}: assist docs should be proper sentences, with capitalization and a full stop at the end.\n\n{}\n\n", 57 "\n\n{}: assist docs should be proper sentences, with capitalization and a full stop at the end.\n\n{}\n\n",
58 id, doc, 58 id, doc,
59 ); 59 );
diff --git a/xtask/src/codegen/gen_parser_tests.rs b/xtask/src/codegen/gen_parser_tests.rs
index db1e59dac..d0f0f683b 100644
--- a/xtask/src/codegen/gen_parser_tests.rs
+++ b/xtask/src/codegen/gen_parser_tests.rs
@@ -102,12 +102,10 @@ fn tests_from_dir(dir: &Path) -> Result<Tests> {
102 for test in collect_tests(&text) { 102 for test in collect_tests(&text) {
103 if test.ok { 103 if test.ok {
104 if let Some(old_test) = res.ok.insert(test.name.clone(), test) { 104 if let Some(old_test) = res.ok.insert(test.name.clone(), test) {
105 Err(format!("Duplicate test: {}", old_test.name))? 105 return Err(format!("Duplicate test: {}", old_test.name).into());
106 }
107 } else {
108 if let Some(old_test) = res.err.insert(test.name.clone(), test) {
109 Err(format!("Duplicate test: {}", old_test.name))?
110 } 106 }
107 } else if let Some(old_test) = res.err.insert(test.name.clone(), test) {
108 return Err(format!("Duplicate test: {}", old_test.name).into());
111 } 109 }
112 } 110 }
113 Ok(()) 111 Ok(())