Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/syntax.rs')
| -rw-r--r-- | helix-core/src/syntax.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index ab6bcc1f..7be512f5 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1431,8 +1431,11 @@ impl Syntax { // The `captures` iterator borrows the `Tree` and the `QueryCursor`, which // prevents them from being moved. But both of these values are really just // pointers, so it's actually ok to move them. - let cursor_ref = - unsafe { mem::transmute::<_, &'static mut QueryCursor>(&mut cursor) }; + let cursor_ref = unsafe { + mem::transmute::<&mut tree_sitter::QueryCursor, &mut tree_sitter::QueryCursor>( + &mut cursor, + ) + }; // if reusing cursors & no range this resets to whole range cursor_ref.set_byte_range(range.clone().unwrap_or(0..usize::MAX)); @@ -1737,7 +1740,7 @@ pub(crate) fn generate_edits( } use std::sync::atomic::{AtomicUsize, Ordering}; -use std::{iter, mem, ops, str, usize}; +use std::{iter, mem, ops, str}; use tree_sitter::{ Language as Grammar, Node, Parser, Point, Query, QueryCaptures, QueryCursor, QueryError, QueryMatch, Range, TextProvider, Tree, |