Merge pull request #1397 from tree-sitter/fix/mark-set-cancellation-self-as-mutable

binding(rust): Mark set_cancellation_flag self as mutable
This commit is contained in:
Max Brunsfeld 2021-09-21 13:38:03 -07:00 committed by GitHub
commit 74152feef0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -630,7 +630,7 @@ impl Parser {
/// If a pointer is assigned, then the parser will periodically read from
/// this pointer during parsing. If it reads a non-zero value, it will halt early,
/// returning `None`. See [parse](Parser::parse) for more information.
pub unsafe fn set_cancellation_flag(&self, flag: Option<&AtomicUsize>) {
pub unsafe fn set_cancellation_flag(&mut self, flag: Option<&AtomicUsize>) {
if let Some(flag) = flag {
ffi::ts_parser_set_cancellation_flag(
self.0.as_ptr(),