]> git.lizzy.rs Git - rust.git/commitdiff
Use cloned over map + clone
authorVille Penttinen <villem.penttinen@gmail.com>
Wed, 13 Feb 2019 15:42:15 +0000 (17:42 +0200)
committerVille Penttinen <villem.penttinen@gmail.com>
Wed, 13 Feb 2019 15:42:15 +0000 (17:42 +0200)
crates/ra_ide_api/src/symbol_index.rs

index 62d0979fe52404a00c407981dd9cc4b69b31810d..100df8279085751ea2734c18b7ed224d704bd2e6 100644 (file)
@@ -228,7 +228,7 @@ fn source_file_to_file_symbols(source_file: &SourceFile, file_id: FileId) -> Vec
         match event {
             WalkEvent::Enter(node) => {
                 if let Some(mut symbol) = to_file_symbol(node, file_id) {
-                    symbol.container_name = stack.last().map(|v: &SmolStr| v.clone());
+                    symbol.container_name = stack.last().cloned();
 
                     stack.push(symbol.name.clone());
                     symbols.push(symbol);