From 0f2edf471a6e346eec581eb500cb6098b1218ada Mon Sep 17 00:00:00 2001 From: laurent Date: Fri, 20 Dec 2024 14:10:39 +0100 Subject: [PATCH] Cleanup. --- src/lib.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f659ddb..2386df4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,12 +81,7 @@ impl FileReader { fn decode(&mut self, start_sec: f64, duration_sec: f64, py: Python) -> PyResult { let (data, _unpadded_len) = self.inner.decode(start_sec, duration_sec, false).w_f(&self.path)?; - Ok(numpy::PyArray2::from_vec2(py, &data) - .unwrap() - .into_pyobject(py) - .unwrap() - .into_any() - .unbind()) + Ok(numpy::PyArray2::from_vec2(py, &data)?.into_any().unbind()) } /// Decodes the audio data from `start_sec` to `start_sec + duration_sec` and return the PCM