aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-30 17:39:18 +0000
committerGitHub <[email protected]>2019-10-30 17:39:18 +0000
commiteee55d4663084a01ce80f5ee201d8e1e345417cd (patch)
tree7fc1497065d00cfba1cd00523ed9545886745da1 /xtask
parentd929f9c49bceb3b7c32ea45c5e55c42f168bbf34 (diff)
parentb441b4e8effeaf4532fd2e45c4d864480857c49e (diff)
Merge #2129
2129: Some clippy fixes r=kjeremy a=kjeremy Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/codegen/gen_assists_docs.rs2
-rw-r--r--xtask/src/codegen/gen_parser_tests.rs8
-rw-r--r--xtask/src/main.rs2
-rw-r--r--xtask/tests/tidy-tests/docs.rs2
4 files changed, 6 insertions, 8 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(())
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<()> {
60 matches.finish().or_else(handle_extra_flags)?; 60 matches.finish().or_else(handle_extra_flags)?;
61 let opts = InstallOpt { 61 let opts = InstallOpt {
62 client: if server { None } else { Some(ClientOpt::VsCode) }, 62 client: if server { None } else { Some(ClientOpt::VsCode) },
63 server: if client_code { None } else { Some(ServerOpt { jemalloc: jemalloc }) }, 63 server: if client_code { None } else { Some(ServerOpt { jemalloc }) },
64 }; 64 };
65 install(opts)? 65 install(opts)?
66 } 66 }
diff --git a/xtask/tests/tidy-tests/docs.rs b/xtask/tests/tidy-tests/docs.rs
index b766aeff1..6a629ce63 100644
--- a/xtask/tests/tidy-tests/docs.rs
+++ b/xtask/tests/tidy-tests/docs.rs
@@ -29,7 +29,7 @@ fn is_exclude_file(d: &DirEntry) -> bool {
29} 29}
30 30
31fn is_hidden(entry: &DirEntry) -> bool { 31fn is_hidden(entry: &DirEntry) -> bool {
32 entry.file_name().to_str().map(|s| s.starts_with(".")).unwrap_or(false) 32 entry.file_name().to_str().map(|s| s.starts_with('.')).unwrap_or(false)
33} 33}
34 34
35#[test] 35#[test]