replace format!("") with String::new()

use array explicitly instead of vec for const content (even if optimizer smart enought to remove allocation)
This commit is contained in:
klensy 2021-10-09 19:55:29 +03:00
parent 1af55d19c7
commit aad48f71b3

View File

@ -1074,7 +1074,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
min_captures: Option<&ty::RootVariableMinCaptureList<'tcx>>,
) -> (Vec<MigrationDiagnosticInfo>, String) {
let Some(upvars) = self.tcx.upvars_mentioned(closure_def_id) else {
return (Vec::new(), format!(""));
return (Vec::new(), String::new());
};
let mut need_migrations = Vec::new();