avoid cloning and then iterating

This commit is contained in:
KaDiWa
2022-08-13 15:50:01 +02:00
parent 75b7e52e92
commit 4eebcb9910
12 changed files with 31 additions and 31 deletions

View File

@@ -387,7 +387,7 @@ impl<'a> Parser<'a> {
/// This is to avoid losing unclosed delims errors `create_snapshot_for_diagnostic` clears.
pub(super) fn restore_snapshot(&mut self, snapshot: SnapshotParser<'a>) {
*self = snapshot.parser;
self.unclosed_delims.extend(snapshot.unclosed_delims.clone());
self.unclosed_delims.extend(snapshot.unclosed_delims);
}
pub fn unclosed_delims(&self) -> &[UnmatchedBrace] {