From b441b4e8effeaf4532fd2e45c4d864480857c49e Mon Sep 17 00:00:00 2001 From: kjeremy Date: Wed, 30 Oct 2019 13:36:37 -0400 Subject: Some clippy fixes --- xtask/src/codegen/gen_assists_docs.rs | 2 +- xtask/src/codegen/gen_parser_tests.rs | 8 +++----- xtask/src/main.rs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'xtask/src') 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> { 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 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 { 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(()) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 04dca402c..4d20232ff 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -60,7 +60,7 @@ fn main() -> Result<()> { matches.finish().or_else(handle_extra_flags)?; let opts = InstallOpt { client: if server { None } else { Some(ClientOpt::VsCode) }, - server: if client_code { None } else { Some(ServerOpt { jemalloc: jemalloc }) }, + server: if client_code { None } else { Some(ServerOpt { jemalloc }) }, }; install(opts)? } -- cgit v1.2.3