diff --git a/src/lib.rs b/src/lib.rs index b2137d4..5646d89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -336,8 +336,8 @@ impl Display { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { - Self::Frontend(err) => write!(f, "Invalid compressed data: {}", err), - Self::Backend(err) => write!(f, "Error while reading compressed data: {}", err), + Self::Frontend(err) => write!(f, "Invalid compressed data: {err}"), + Self::Backend(err) => write!(f, "Error while reading compressed data: {err}"), } } } diff --git a/src/pybindings/stream/chain.rs b/src/pybindings/stream/chain.rs index 19343ab..5af1c7e 100644 --- a/src/pybindings/stream/chain.rs +++ b/src/pybindings/stream/chain.rs @@ -265,9 +265,9 @@ impl ChainCoder { /// [`CustomModel`](model.html#constriction.stream.model.CustomModel) or /// [`ScipyModel`](model.html#constriction.stream.model.ScipyModel) model class. #[pyo3(text_signature = "(DEPRECATED)")] - pub fn encode_iid_custom_model_reverse<'py>( + pub fn encode_iid_custom_model_reverse( &mut self, - py: Python<'py>, + py: Python<'_>, symbols: PyReadonlyArray1<'_, i32>, model: &Model, ) -> PyResult<()> { @@ -293,9 +293,9 @@ impl ChainCoder { /// entropy model). #[pyo3(text_signature = "(model, optional_amt_or_model_params)")] #[args(symbols, model, params = "*")] - pub fn decode<'py>( + pub fn decode( &mut self, - py: Python<'py>, + py: Python<'_>, model: &Model, params: &PyTuple, ) -> PyResult { @@ -434,9 +434,9 @@ impl ChainCoder { /// [`CustomModel`](model.html#constriction.stream.model.CustomModel) or /// [`ScipyModel`](model.html#constriction.stream.model.ScipyModel) model class. #[pyo3(text_signature = "(DEPRECATED)")] - pub fn decode_iid_custom_model<'py>( + pub fn decode_iid_custom_model( &mut self, - py: Python<'py>, + py: Python<'_>, amt: usize, model: &Model, ) -> PyResult { diff --git a/src/pybindings/stream/model/internals.rs b/src/pybindings/stream/model/internals.rs index 60a2768..a97fcac 100644 --- a/src/pybindings/stream/model/internals.rs +++ b/src/pybindings/stream/model/internals.rs @@ -258,9 +258,9 @@ impl Model for UnspecializedPythonModel { (callback)(&self.quantizer.quantize(distribution)) } - fn parameterize<'py>( + fn parameterize( &self, - py: Python<'py>, + py: Python<'_>, params: &PyTuple, reverse: bool, callback: &mut dyn FnMut(&dyn DefaultEntropyModel) -> PyResult<()>, diff --git a/src/pybindings/stream/queue.rs b/src/pybindings/stream/queue.rs index d87246a..fcfbad0 100644 --- a/src/pybindings/stream/queue.rs +++ b/src/pybindings/stream/queue.rs @@ -535,9 +535,9 @@ impl RangeEncoder { /// print(encoder.get_compressed()) # (prints: [1204741195, 2891990943]) /// ``` #[pyo3(text_signature = "(DEPRECATED)")] - pub fn encode_iid_custom_model<'py>( + pub fn encode_iid_custom_model( &mut self, - py: Python<'py>, + py: Python<'_>, symbols: PyReadonlyArray1<'_, i32>, model: &Model, ) -> PyResult<()> { @@ -899,9 +899,9 @@ impl RangeDecoder { /// ``` #[pyo3(text_signature = "(model, optional_amt_or_model_params)")] #[args(symbols, model, params = "*")] - pub fn decode<'py>( + pub fn decode( &mut self, - py: Python<'py>, + py: Python<'_>, model: &Model, params: &PyTuple, ) -> PyResult { @@ -978,9 +978,9 @@ impl RangeDecoder { /// [`CustomModel`](model.html#constriction.stream.model.CustomModel) and /// [`ScipyModel`](model.html#constriction.stream.model.ScipyModel). #[pyo3(text_signature = "(DEPRECATED)")] - pub fn decode_iid_custom_model<'py>( + pub fn decode_iid_custom_model( &mut self, - py: Python<'py>, + py: Python<'_>, amt: usize, model: &Model, ) -> PyResult { diff --git a/src/pybindings/stream/stack.rs b/src/pybindings/stream/stack.rs index 461ad1c..04ca9f4 100644 --- a/src/pybindings/stream/stack.rs +++ b/src/pybindings/stream/stack.rs @@ -721,9 +721,9 @@ impl AnsCoder { /// print(coder.get_compressed()) # (prints: [609762275, 3776398430]) /// ``` #[pyo3(text_signature = "(DEPRECATED)")] - pub fn encode_iid_custom_model_reverse<'py>( + pub fn encode_iid_custom_model_reverse( &mut self, - py: Python<'py>, + py: Python<'_>, symbols: PyReadonlyArray1<'_, i32>, model: &Model, ) -> PyResult<()> { @@ -835,9 +835,9 @@ impl AnsCoder { /// ``` #[pyo3(text_signature = "(model, optional_amt_or_model_params)")] #[args(symbols, model, params = "*")] - pub fn decode<'py>( + pub fn decode( &mut self, - py: Python<'py>, + py: Python<'_>, model: &Model, params: &PyTuple, ) -> PyResult { @@ -1076,9 +1076,9 @@ impl AnsCoder { /// [`CustomModel`](model.html#constriction.stream.model.CustomModel) and /// [`ScipyModel`](model.html#constriction.stream.model.ScipyModel). #[pyo3(text_signature = "(DEPRECATED)")] - pub fn decode_iid_custom_model<'py>( + pub fn decode_iid_custom_model( &mut self, - py: Python<'py>, + py: Python<'_>, amt: usize, model: &Model, ) -> PyResult { diff --git a/src/stream/chain.rs b/src/stream/chain.rs index 86edaed..095d81c 100644 --- a/src/stream/chain.rs +++ b/src/stream/chain.rs @@ -841,10 +841,10 @@ impl core::fmt fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { Self::Compressed(err) => { - write!(f, "Read/write error when accessing compressed: {}", err) + write!(f, "Read/write error when accessing compressed: {err}") } Self::Remainders(err) => { - write!(f, "Read/write error when accessing remainders: {}", err) + write!(f, "Read/write error when accessing remainders: {err}") } } } @@ -884,18 +884,10 @@ where fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { ChangePrecisionError::Increase(err) => { - write!( - f, - "Error while increasing precision of chain coder: {}", - err - ) + write!(f, "Error while increasing precision of chain coder: {err}") } ChangePrecisionError::Decrease(err) => { - write!( - f, - "Error while decreasing precision of chain coder: {}", - err - ) + write!(f, "Error while decreasing precision of chain coder: {err}") } } } diff --git a/src/stream/mod.rs b/src/stream/mod.rs index 7a807c1..c431622 100644 --- a/src/stream/mod.rs +++ b/src/stream/mod.rs @@ -1330,10 +1330,10 @@ impl Display fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { Self::InvalidEntropyModel(err) => { - write!(f, "Error while constructing entropy model or data: {}", err) + write!(f, "Error while constructing entropy model or data: {err}") } Self::CodingError(err) => { - write!(f, "Error while entropy coding: {}", err) + write!(f, "Error while entropy coding: {err}") } } } diff --git a/src/symbol/mod.rs b/src/symbol/mod.rs index 6b4a99e..ba30630 100644 --- a/src/symbol/mod.rs +++ b/src/symbol/mod.rs @@ -698,7 +698,7 @@ impl Display for SymbolCodeError { f, "The compressed data ended before the current codeword was complete." ), - Self::InvalidCodeword(err) => write!(f, "Invalid codeword for this codebook: {}", err), + Self::InvalidCodeword(err) => write!(f, "Invalid codeword for this codebook: {err}"), } } }