Prefer unwrap_or_else to unwrap_or in case of function calls/allocations
This commit is contained in:
parent
cb5e1b93e3
commit
d28aed6dc4
35 changed files with 57 additions and 54 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue