mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Some clippy fixes
This commit is contained in:
parent
5806195bc1
commit
b441b4e8ef
17 changed files with 23 additions and 29 deletions
|
@ -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,
|
||||
);
|
||||
|
|
|
@ -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(())
|
||||
|
|
|
@ -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)?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue