Skip to content

Commit dde46c9

Browse files
committed
Replace complex conditional with pattern matching
1 parent 1573d10 commit dde46c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/tabs_in_doc_comments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn get_chunks_of_tabs(the_str: &str) -> Vec<(u32, u32)> {
106106

107107
let char_indices: Vec<_> = the_str.char_indices().collect();
108108

109-
if char_indices.len() == 1 && char_indices.first().unwrap().1 == '\t' {
109+
if let &[(_, '\t')] = &char_indices.as_slice() {
110110
return vec![(0, 1)];
111111
}
112112

0 commit comments

Comments
 (0)