Fix, reference by value for Language as everywhere

This commit is contained in:
Andrew Hlynskyi 2023-08-01 23:45:01 +03:00
parent 759af6d0a4
commit a08c61235d
2 changed files with 2 additions and 2 deletions

View file

@ -34,7 +34,7 @@ fn test_lookahead_iterator() {
lookahead.reset_state(next_state);
assert!(lookahead.iter_names().eq(expected_symbols));
lookahead.reset(&language, next_state);
lookahead.reset(language, next_state);
assert!(lookahead
.map(|s| language.node_kind_for_id(s).unwrap())
.eq(expected_symbols));

View file

@ -1524,7 +1524,7 @@ impl LookaheadIterator {
/// This returns `true` if the language was set successfully and `false`
/// otherwise.
#[doc(alias = "ts_lookahead_iterator_reset")]
pub fn reset(&self, language: &Language, state: u16) -> bool {
pub fn reset(&self, language: Language, state: u16) -> bool {
unsafe { ffi::ts_lookahead_iterator_reset(self.0.as_ptr(), language.0, state) }
}