1
Fork 0

Prefer unwrap_or_else to unwrap_or in case of function calls/allocations

This commit is contained in:
ljedrz 2018-10-12 16:16:00 +02:00
parent cb5e1b93e3
commit d28aed6dc4
35 changed files with 57 additions and 54 deletions

View file

@ -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())
}),
}
}