Prefer unwrap_or_else to unwrap_or in case of function calls/allocations
This commit is contained in:
parent
cb5e1b93e3
commit
d28aed6dc4
35 changed files with 57 additions and 54 deletions
|
@ -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())
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue