1
Fork 0

Prefer unwrap_or_else to unwrap_or in case of function calls/allocations

This commit is contained in:
ljedrz 2018-10-12 16:16:00 +02:00
parent cb5e1b93e3
commit d28aed6dc4
35 changed files with 57 additions and 54 deletions

View file

@ -154,7 +154,7 @@ pub fn from_fn_attrs(
id: Option<DefId>,
) {
let codegen_fn_attrs = id.map(|id| cx.tcx.codegen_fn_attrs(id))
.unwrap_or(CodegenFnAttrs::new());
.unwrap_or_else(|| CodegenFnAttrs::new());
inline(cx, llfn, codegen_fn_attrs.inline);