Prefer unwrap_or_else to unwrap_or in case of function calls/allocations The contents of `unwrap_or` are evaluated eagerly, so it's not a good pick in case of function calls and allocations. This PR also changes a few `unwrap_or`s with `unwrap_or_default`. An added bonus is that in some cases this change also reveals if the object it's called on is an `Option` or a `Result` (based on whether the closure takes an argument). |
||
|---|---|---|
| .. | ||
| build.rs | ||
| Cargo.toml | ||
| creader.rs | ||
| cstore.rs | ||
| cstore_impl.rs | ||
| decoder.rs | ||
| diagnostics.rs | ||
| dynamic_lib.rs | ||
| encoder.rs | ||
| foreign_modules.rs | ||
| index.rs | ||
| index_builder.rs | ||
| isolated_encoder.rs | ||
| lib.rs | ||
| link_args.rs | ||
| locator.rs | ||
| native_libs.rs | ||
| schema.rs | ||