diff options
| author | klensy <klensy@users.noreply.github.com> | 2021-02-25 04:13:42 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2021-02-25 04:21:12 +0300 |
| commit | 08b1e8004b06112fb8334155b2cea314bd3e8161 (patch) | |
| tree | d266e7a711f68b71ec9808b3e6caee5000f2d171 /compiler/rustc_parse/src/parser/diagnostics.rs | |
| parent | c75c4a579bdea69fc9b93697aa2531daf82540fc (diff) | |
| download | rust-08b1e8004b06112fb8334155b2cea314bd3e8161.tar.gz rust-08b1e8004b06112fb8334155b2cea314bd3e8161.zip | |
fix review
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -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 b5b5278b5ce..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_else(|| 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 "); |
