diff options
| author | bors <bors@rust-lang.org> | 2021-02-26 19:17:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-26 19:17:00 +0000 |
| commit | 9c09c1f7cfcf9de0522bcd1cfda32b552195c464 (patch) | |
| tree | 7fbf5611f6306f6ea0bb25d163d234cf17c3ac38 /compiler/rustc_parse/src | |
| parent | cecdb181ade91c0a5ffab9a148dba68fc7d00ee3 (diff) | |
| parent | 0da9b474de36bf7954ceb51a0e483cc39e9d60da (diff) | |
| download | rust-9c09c1f7cfcf9de0522bcd1cfda32b552195c464.tar.gz rust-9c09c1f7cfcf9de0522bcd1cfda32b552195c464.zip | |
Auto merge of #82552 - GuillaumeGomez:rollup-8dn1ztn, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - #81940 (Stabilize str_split_once) - #82165 (Reword labels on E0308 involving async fn return type) - #82456 (Replaced some unwrap_or and map_or with lazy variants) - #82491 (Consider inexpensive inlining criteria first) - #82506 (Properly account for non-shorthand pattern field in unused variable lint) - #82535 (Set codegen thread names) - #82545 (rustdoc: add optional woff2 versions of FiraSans.) - #82549 (Revert "Update normalize.css to 8.0.1") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 0f49386dec0..5b4939b7407 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -223,7 +223,7 @@ impl<'a> Parser<'a> { fn tokens_to_string(tokens: &[TokenType]) -> String { let mut i = tokens.iter(); // This might be a sign we need a connect method on `Iterator`. - let b = i.next().map_or(String::new(), |t| t.to_string()); + let b = i.next().map_or_else(String::new, |t| t.to_string()); i.enumerate().fold(b, |mut b, (i, a)| { if tokens.len() > 2 && i == tokens.len() - 2 { b.push_str(", or "); |
