Merge pull request #911 from michalmuskala/cursor-clone
Implement Clone for TreeCursor
This commit is contained in:
commit
f65b499a7c
1 changed files with 6 additions and 0 deletions
|
|
@ -1147,6 +1147,12 @@ impl<'a> TreeCursor<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Clone for TreeCursor<'a> {
|
||||
fn clone(&self) -> Self {
|
||||
TreeCursor(unsafe { ffi::ts_tree_cursor_copy(&self.0) }, PhantomData)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Drop for TreeCursor<'a> {
|
||||
fn drop(&mut self) {
|
||||
unsafe { ffi::ts_tree_cursor_delete(&mut self.0) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue