Page MenuHomeDevCentral

Lazy evaluate default values
ClosedPublic

Authored by dereckson on May 30 2020, 22:52.
Tags
None
Referenced Files
F55702994: D2289.diff
Sat, Oct 31, 00:21
F55656576: D2289.id5767.diff
Fri, Oct 30, 16:41
F55656219: D2289.id5769.diff
Fri, Oct 30, 16:39
Unknown Object (File)
Fri, Oct 30, 10:43
Unknown Object (File)
Sun, Oct 18, 21:59
Unknown Object (File)
Fri, Oct 16, 19:33
Unknown Object (File)
Sun, Oct 11, 01:49
Unknown Object (File)
Sat, Oct 10, 13: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.