Use filter_map rather than flat_map
commite22dbf102fea06fe7c4292635543ca2e521d299f
authorBlaž Hrastnik <blaz@mxxn.io>
dateMon 10 Jan 2022, 00:42 (5 years ago)
parent2f4a9fe
helix-core/src/syntax.rs+1−1
@@ -723,7 +723,7 @@ impl Syntax {
723723 let mut layers = self
724724 .layers
725725 .iter()
726− .flat_map(|(_, layer)| {
726+ .filter_map(|(_, layer)| {
727727 // Reuse a cursor from the pool if available.
728728 let mut cursor = PARSER.with(|ts_parser| {
729729 let highlighter = &mut ts_parser.borrow_mut();