Skip to content

Commit

Permalink
Merge pull request #89 from monoamine11231/main
Browse files Browse the repository at this point in the history
Clone traits implemented
  • Loading branch information
messense authored May 17, 2024
2 parents aef0aeb + b97aef5 commit 4cca7dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ impl Drop for Document {
}
}

impl Clone for Document {
fn clone(&self) -> Self {
unsafe { Document::from_raw(fz_keep_document(context(), self.inner)) }
}
}

#[derive(Debug)]
pub struct PageIter<'a> {
index: i32,
Expand Down
6 changes: 6 additions & 0 deletions src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ impl Drop for Page {
}
}

impl Clone for Page {
fn clone(&self) -> Self {
unsafe { Page::from_raw(fz_keep_page(context(), self.inner)) }
}
}

#[derive(Debug)]
pub struct LinkIter {
next: *mut fz_link,
Expand Down

0 comments on commit 4cca7dc

Please sign in to comment.