From 0c37a9cc28a38e87a136e0cad9dcc5512c64029c Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Wed, 13 Feb 2019 17:42:15 +0200 Subject: Use cloned over map + clone --- crates/ra_ide_api/src/symbol_index.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 62d0979fe..100df8279 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -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); -- cgit v1.2.3