Page MenuHomeDevCentral

Lazy evaluate default values
ClosedPublic

Authored by dereckson on May 30 2020, 22:52.
Tags
None
Referenced Files
F24783953: D2289.id5876.diff
Tue, Mar 10, 12:30
F24783131: D2289.id5767.diff
Tue, Mar 10, 12:12
F24778831: D2289.id5767.diff
Tue, Mar 10, 08:55
F24778821: D2289.id5769.diff
Tue, Mar 10, 08:55
F24776787: D2289.diff
Tue, Mar 10, 07:21
F24766771: D2289.id5769.diff
Mon, Mar 9, 20:48
Unknown Object (File)
Mon, Mar 9, 15:41
Unknown Object (File)
Mon, Mar 9, 09:47
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 Not Applicable
Unit
Tests Not Applicable

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.