From ed3d93b875f25da6f81b8a107a8c200311240627 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Tue, 4 Jun 2019 02:38:13 -0400 Subject: Fix clippy::single_char_pattern --- crates/ra_syntax/src/ast/extensions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index e4c99784c..930b2d9fa 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs @@ -78,7 +78,7 @@ impl ast::Attr { if attr.kind() == IDENT { let key = attr.as_token()?.text().clone(); let val_node = tt_node.children_with_tokens().find(|t| t.kind() == STRING)?; - let val = val_node.as_token()?.text().trim_start_matches("\"").trim_end_matches("\""); + let val = val_node.as_token()?.text().trim_start_matches('"').trim_end_matches('"'); Some((key, SmolStr::new(val))) } else { None -- cgit v1.2.3 From b28ca32db22d5e2ed34db556c6fd50a5fc2d679c Mon Sep 17 00:00:00 2001 From: Alan Du Date: Mon, 3 Jun 2019 10:27:51 -0400 Subject: Fix clippy::or_fun_call --- crates/ra_syntax/src/validation/unescape.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/validation/unescape.rs b/crates/ra_syntax/src/validation/unescape.rs index 2086046b6..91dbcfae8 100644 --- a/crates/ra_syntax/src/validation/unescape.rs +++ b/crates/ra_syntax/src/validation/unescape.rs @@ -255,7 +255,7 @@ where let first_non_space = str .bytes() .position(|b| b != b' ' && b != b'\t' && b != b'\n' && b != b'\r') - .unwrap_or(str.len()); + .unwrap_or_else(|| str.len()); *chars = str[first_non_space..].chars() } } -- cgit v1.2.3