]> git.lizzy.rs Git - rust.git/commitdiff
Unnecessary `to_string`
authorShotaro Yamada <sinkuu@sinkuu.xyz>
Sat, 17 Mar 2018 00:46:32 +0000 (09:46 +0900)
committerShotaro Yamada <sinkuu@sinkuu.xyz>
Fri, 27 Jul 2018 14:26:36 +0000 (23:26 +0900)
src/librustc_codegen_llvm/back/symbol_export.rs

index 94357f348497d96c3edd11f480f165475d95659c..48de2f3beedfb68dc846eff0f9ad8c38107228e0 100644 (file)
@@ -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));
     }