diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index 7c780738..3a0e41dd 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -90,7 +90,7 @@ impl ChunkSizer for CustomCallback { fn size(&self, chunk: &str) -> usize { Python::with_gil(|py| { self.0 - .call_bound(py, (chunk,), None) + .call(py, (chunk,), None) .unwrap() .extract::(py) .unwrap() @@ -127,10 +127,10 @@ impl<'text> ByteToCharOffsetTracker<'text> { } /// Allows for dynamically choosing between different chunk sizers -struct Sizer(Box); +struct Sizer(Box); impl Sizer { - fn new(sizer: impl ChunkSizer + 'static + Send) -> Self { + fn new(sizer: impl ChunkSizer + 'static + Send + Sync) -> Self { Self(Box::new(sizer)) } }