Use cloned over map + clone

This commit is contained in:
Ville Penttinen 2019-02-13 17:42:15 +02:00
parent d9905f7be5
commit 0c37a9cc28

View 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);