diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-10-12 16:16:00 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-10-19 09:45:45 +0200 |
| commit | d28aed6dc45ffccc790469cb04f3f775ddb2283a (patch) | |
| tree | c1a3c356ba1ffc8173746e03f0f630ae4032624f /src/libsyntax/tokenstream.rs | |
| parent | cb5e1b93e300cf9772a24c6de27d9f21cdae3123 (diff) | |
| download | rust-d28aed6dc45ffccc790469cb04f3f775ddb2283a.tar.gz rust-d28aed6dc45ffccc790469cb04f3f775ddb2283a.zip | |
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations
Diffstat (limited to 'src/libsyntax/tokenstream.rs')
| -rw-r--r-- | src/libsyntax/tokenstream.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs index 70867f9e42f..29bd63d28c5 100644 --- a/src/libsyntax/tokenstream.rs +++ b/src/libsyntax/tokenstream.rs @@ -606,7 +606,7 @@ impl Cursor { CursorKind::JointTree(ref tree, _) => tree.clone().joint(), CursorKind::Stream(ref cursor) => TokenStream::concat_rc_vec({ cursor.stack.get(0).cloned().map(|(stream, _)| stream) - .unwrap_or(cursor.stream.clone()) + .unwrap_or_else(|| cursor.stream.clone()) }), } } |
