Page MenuHomeDevCentral

Lazy evaluate default values
ClosedPublic

Authored by dereckson on May 30 2020, 22:52.
Tags
None
Referenced Files
F14821656: D2289.id5769.diff
Sun, Nov 30, 18:49
F14708709: D2289.id5767.diff
Sun, Nov 30, 04:18
Unknown Object (File)
Fri, Nov 28, 18:10
Unknown Object (File)
Fri, Nov 28, 17:59
Unknown Object (File)
Fri, Nov 28, 09:12
Unknown Object (File)
Fri, Nov 28, 09:12
Unknown Object (File)
Thu, Nov 27, 23:56
Unknown Object (File)
Wed, Nov 26, 21:13
Subscribers
None

Details

Summary

The unwrap_or_else method allows to pass a closure,
and so allows lazy evaluation of the argument.

Test Plan

println!("Mounting at {}", entry_point);

Diff Detail

Repository
rLF Limiting Factor
Lint
Lint Passed
Unit
No Test Coverage
Branch
fix-unwrap-or
Build Status
Buildable 3558
Build 3807: arc lint + arc unit

Event Timeline

dereckson created this revision.

I'm not sure the performance improvement justify a commit. These kind of optimization can probably be done by the compiler because String::from("/") have no side effect.

This revision is now accepted and ready to land.Sep 24 2020, 20:05
This revision was automatically updated to reflect the committed changes.