ca2639e82e
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). |
||
---|---|---|
.. | ||
attr | ||
diagnostics | ||
ext | ||
parse | ||
util | ||
ast.rs | ||
build.rs | ||
Cargo.toml | ||
config.rs | ||
diagnostic_list.rs | ||
early_buffered_lints.rs | ||
entry.rs | ||
feature_gate.rs | ||
fold.rs | ||
json.rs | ||
lib.rs | ||
ptr.rs | ||
README.md | ||
show_span.rs | ||
source_map.rs | ||
std_inject.rs | ||
str.rs | ||
test_snippet.rs | ||
test.rs | ||
tokenstream.rs | ||
visit.rs |
The syntax
crate contains those things concerned purely with syntax
– that is, the AST ("abstract syntax tree"), parser, pretty-printer,
lexer, macro expander, and utilities for traversing ASTs.
For more information about how these things work in rustc, see the rustc guide: