Prefer cloned over map + clone in parse_block

Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
This commit is contained in:
Collin Chin 2020-10-27 11:20:01 -07:00 committed by GitHub
parent d5d34d3bdf
commit 6cb0d5c3c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -384,7 +384,7 @@ impl Frame {
/// ///
fn parse_block(&mut self, statements: impl Iterator<Item = Statement>, _span: &Span) -> Result<(), FrameError> { fn parse_block(&mut self, statements: impl Iterator<Item = Statement>, _span: &Span) -> Result<(), FrameError> {
// Push new scope. // Push new scope.
let scope = Scope::new(self.scopes.last().map(|scope| scope.clone())); let scope = Scope::new(self.scopes.last().cloned());
self.push_scope(scope); self.push_scope(scope);
// Parse all statements. // Parse all statements.