about summary refs log tree commit diff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
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 0c4cf21529d..05afda8f111 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>> {
 
             let doc = take_until(lines.by_ref(), "```").trim().to_string();
             assert!(
-                doc.chars().next().unwrap().is_ascii_uppercase() && doc.ends_with("."),
+                doc.chars().next().unwrap().is_ascii_uppercase() && doc.ends_with('.'),
                 "\n\n{}: assist docs should be proper sentences, with capitalization and a full stop at the end.\n\n{}\n\n",
                 id, doc,
             );
diff --git a/xtask/src/codegen/gen_parser_tests.rs b/xtask/src/codegen/gen_parser_tests.rs
index db1e59daccc..d0f0f683b81 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> {
         for test in collect_tests(&text) {
             if test.ok {
                 if let Some(old_test) = res.ok.insert(test.name.clone(), test) {
-                    Err(format!("Duplicate test: {}", old_test.name))?
-                }
-            } else {
-                if let Some(old_test) = res.err.insert(test.name.clone(), test) {
-                    Err(format!("Duplicate test: {}", old_test.name))?
+                    return Err(format!("Duplicate test: {}", old_test.name).into());
                 }
+            } else if let Some(old_test) = res.err.insert(test.name.clone(), test) {
+                return Err(format!("Duplicate test: {}", old_test.name).into());
             }
         }
         Ok(())