From dde46c9340994ad396a8677702be58122384a5ed Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Sat, 10 Apr 2021 14:42:33 +0200 Subject: [PATCH] Replace complex conditional with pattern matching --- clippy_lints/src/tabs_in_doc_comments.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/tabs_in_doc_comments.rs b/clippy_lints/src/tabs_in_doc_comments.rs index 3f9692540f7..d68227545a6 100644 --- a/clippy_lints/src/tabs_in_doc_comments.rs +++ b/clippy_lints/src/tabs_in_doc_comments.rs @@ -106,7 +106,7 @@ fn get_chunks_of_tabs(the_str: &str) -> Vec<(u32, u32)> { let char_indices: Vec<_> = the_str.char_indices().collect(); - if char_indices.len() == 1 && char_indices.first().unwrap().1 == '\t' { + if let &[(_, '\t')] = &char_indices.as_slice() { return vec![(0, 1)]; }