From: Shotaro Yamada Date: Sat, 17 Mar 2018 00:46:32 +0000 (+0900) Subject: Unnecessary `to_string` X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=4c1cb7534b950d8135279f1ae3aae09137ef7815;p=rust.git Unnecessary `to_string` --- diff --git a/src/librustc_codegen_llvm/back/symbol_export.rs b/src/librustc_codegen_llvm/back/symbol_export.rs index 94357f34849..48de2f3beed 100644 --- a/src/librustc_codegen_llvm/back/symbol_export.rs +++ b/src/librustc_codegen_llvm/back/symbol_export.rs @@ -206,9 +206,8 @@ fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, }) .collect(); - if let Some(_) = *tcx.sess.entry_fn.borrow() { - let symbol_name = "main".to_string(); - let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(&symbol_name)); + if tcx.sess.entry_fn.borrow().is_some() { + let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new("main")); symbols.push((exported_symbol, SymbolExportLevel::C)); }