diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index 04dd78bf..068a6028 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -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(),