Skip to content

Commit 3498ff0

Browse files
committed
Cleanup
1 parent af86705 commit 3498ff0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ keywords = ["dicom pydicom python rle pylibjpeg rust"]
3333
license = "MIT"
3434
name = "pylibjpeg-rle"
3535
readme = "README.md"
36-
version = "2.1.0" #.dev0"
36+
version = "2.1.0"
3737
requires-python = ">=3.9"
3838
dependencies = [
39-
"numpy>=2.2.5",
39+
"numpy>=2.0",
4040
]
4141

4242
[project.optional-dependencies]

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ use pyo3::exceptions::{PyValueError};
1111
// Python rle module members
1212
#[pymodule]
1313
fn rle(m: &Bound<'_, PyModule>) -> PyResult<()> {
14-
m.add_function(wrap_pyfunction!(parse_header, m)?); //.unwrap();
15-
m.add_function(wrap_pyfunction!(decode_segment, m)?); //.unwrap();
16-
m.add_function(wrap_pyfunction!(decode_frame, m)?); //.unwrap();
14+
m.add_function(wrap_pyfunction!(parse_header, m)?);
15+
m.add_function(wrap_pyfunction!(decode_segment, m)?);
16+
m.add_function(wrap_pyfunction!(decode_frame, m)?);
1717

18-
m.add_function(wrap_pyfunction!(encode_row, m)?); //.unwrap();
19-
m.add_function(wrap_pyfunction!(encode_segment, m)?); //.unwrap();
20-
m.add_function(wrap_pyfunction!(encode_frame, m)?); //.unwrap();
18+
m.add_function(wrap_pyfunction!(encode_row, m)?);
19+
m.add_function(wrap_pyfunction!(encode_segment, m)?);
20+
m.add_function(wrap_pyfunction!(encode_frame, m)?);
2121

2222
Ok(())
2323
}
@@ -757,7 +757,7 @@ fn _encode_row(src: &[u8], dst: &mut Vec<u8>) -> Result<(), Box<dyn Error>> {
757757
match src.len() {
758758
0 => { return Ok(()) },
759759
1 => {
760-
dst.push(0u8); // literal run
760+
dst.push(0); // literal run
761761
dst.push(src[0]);
762762
return Ok(())
763763
},
@@ -795,7 +795,7 @@ fn _encode_row(src: &[u8], dst: &mut Vec<u8>) -> Result<(), Box<dyn Error>> {
795795
dst.push(chunk[0]);
796796
} else {
797797
// If the final chunk is only 1 value long do a literal run instead
798-
dst.push(0u8);
798+
dst.push(0);
799799
dst.push(chunk[0]);
800800
}
801801
}

0 commit comments

Comments
 (0)