Skip to content

Commit 32aa332

Browse files
nbdd0121jwnrt
authored andcommitted
Use array form of starts_with instead of closure form.
Suggested-by: James Wainwright <[email protected]> Signed-off-by: Gary Guo <[email protected]>
1 parent ea0720c commit 32aa332

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/yaml.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -507,12 +507,7 @@ fn need_quotes(string: &str) -> bool {
507507

508508
string.is_empty()
509509
|| need_quotes_spaces(string)
510-
|| string.starts_with(|character: char| {
511-
matches!(
512-
character,
513-
'&' | '*' | '?' | '|' | '-' | '<' | '>' | '=' | '!' | '%' | '@'
514-
)
515-
})
510+
|| string.starts_with(&['&', '*', '?', '|', '-', '<', '>', '=', '!', '%', '@'])
516511
|| string.contains(|character: char| {
517512
matches!(character,
518513
':'

0 commit comments

Comments
 (0)