Merge 'Remove Clone impl for Buffer and PageContent' from Preston Thorpe

After #2258, we no longer need to clone/deep copy `PageContent` or
`Buffer`.
We can remove the implementation to make any copying of page data
explicit.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2453
This commit is contained in:
Preston Thorpe
2025-08-05 16:17:13 -04:00
committed by GitHub
2 changed files with 0 additions and 12 deletions

View File

@@ -270,7 +270,6 @@ pub type BufferData = Pin<Vec<u8>>;
pub type BufferDropFn = Rc<dyn Fn(BufferData)>;
#[derive(Clone)]
pub struct Buffer {
data: ManuallyDrop<BufferData>,
drop: BufferDropFn,

View File

@@ -434,17 +434,6 @@ pub struct PageContent {
pub overflow_cells: Vec<OverflowCell>,
}
impl Clone for PageContent {
fn clone(&self) -> Self {
#[allow(clippy::arc_with_non_send_sync)]
Self {
offset: self.offset,
buffer: Arc::new(RefCell::new((*self.buffer.borrow()).clone())),
overflow_cells: self.overflow_cells.clone(),
}
}
}
impl PageContent {
pub fn new(offset: usize, buffer: Arc<RefCell<Buffer>>) -> Self {
Self {