Enable clippy::single_char_pattern
(#8727)
This PR enables the [`clippy::single_char_pattern`](https://rust-lang.github.io/rust-clippy/master/index.html#/single_char_pattern) rule and fixes the outstanding violations. Release Notes: - N/A
This commit is contained in:
parent
12440d5e0d
commit
5935681c5c
22 changed files with 45 additions and 46 deletions
|
@ -62,7 +62,7 @@ impl LspAdapter for OCamlLspAdapter {
|
|||
language: &Arc<language::Language>,
|
||||
) -> Option<CodeLabel> {
|
||||
let name = &completion.label;
|
||||
let detail = completion.detail.as_ref().map(|s| s.replace("\n", " "));
|
||||
let detail = completion.detail.as_ref().map(|s| s.replace('\n', " "));
|
||||
|
||||
match completion.kind.zip(detail) {
|
||||
// Error of 'b : ('a, 'b) result
|
||||
|
@ -124,7 +124,7 @@ impl LspAdapter for OCamlLspAdapter {
|
|||
// version : string
|
||||
// NOTE: (~|?) are omitted as we don't use them in the fuzzy filtering
|
||||
Some((CompletionItemKind::FIELD, detail))
|
||||
if name.starts_with("~") || name.starts_with("?") =>
|
||||
if name.starts_with('~') || name.starts_with('?') =>
|
||||
{
|
||||
let label = name.trim_start_matches(&['~', '?']);
|
||||
let text = format!("{} : {}", label, detail);
|
||||
|
|
|
@ -129,7 +129,7 @@ impl LspAdapter for TerraformLspAdapter {
|
|||
}
|
||||
|
||||
fn build_download_url(version: String) -> Result<String> {
|
||||
let v = version.strip_prefix("v").unwrap_or(&version);
|
||||
let v = version.strip_prefix('v').unwrap_or(&version);
|
||||
let os = match std::env::consts::OS {
|
||||
"linux" => "linux",
|
||||
"macos" => "darwin",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue