Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillot

Avoid cloning a collection only to iterate over it

`@rustbot` label: +C-cleanup
This commit is contained in:
bors
2022-08-28 18:31:08 +00:00
12 changed files with 31 additions and 31 deletions

View File

@@ -759,7 +759,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] {