We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82ede61 commit 1760c62Copy full SHA for 1760c62
markup5ever/util/buffer_queue.rs
@@ -18,7 +18,7 @@
18
//!
19
//! [`BufferQueue`]: struct.BufferQueue.html
20
21
-use std::{cell::RefCell, collections::VecDeque};
+use std::{cell::RefCell, collections::VecDeque, mem};
22
23
use tendril::StrTendril;
24
@@ -235,6 +235,14 @@ impl BufferQueue {
235
236
result
237
}
238
+
239
+ pub fn replace_with(&self, other: BufferQueue) {
240
+ let _ = mem::replace(&mut *self.buffers.borrow_mut(), other.buffers.take());
241
+ }
242
243
+ pub fn swap_with(&self, other: &BufferQueue) {
244
+ mem::swap(&mut *self.buffers.borrow_mut(), &mut *other.buffers.borrow_mut());
245
246
247
248
#[cfg(test)]
0 commit comments