Version 2.1.0

This commit is contained in:
Luke Street 2025-10-17 15:18:40 -06:00
parent fe436d4386
commit ba32c59ef3
2 changed files with 6 additions and 10 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "lzokay" name = "lzokay"
version = "2.0.1" version = "2.1.0"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
repository = "https://github.com/encounter/lzokay-rs" repository = "https://github.com/encounter/lzokay-rs"
@ -18,9 +18,9 @@ alloc = ["zerocopy/alloc"]
std = ["alloc", "zerocopy/std"] std = ["alloc", "zerocopy/std"]
decompress = [] decompress = []
compress = [] compress = []
python = ["pyo3/extension-module", "compress", "decompress", "std"] python = ["pyo3", "compress", "decompress", "std"]
default = ["compress", "decompress", "std"] default = ["compress", "decompress", "std"]
[dependencies] [dependencies]
zerocopy = { version = "0.8.27", default-features = false, features = ["derive"] } zerocopy = { version = "0.8.27", default-features = false, features = ["derive"] }
pyo3 = { version = "0.26.0", features = ["extension-module", "abi3-py310", "generate-import-lib"], optional = true } pyo3 = { version = "0.26.0", features = ["abi3-py310", "extension-module", "generate-import-lib"], optional = true }

View File

@ -69,7 +69,7 @@ pub enum Error {
} }
impl Error { impl Error {
/// Returns the error message as a string slice. /// Returns the error message as a string.
pub const fn as_str(self) -> &'static str { pub const fn as_str(self) -> &'static str {
match self { match self {
Error::LookbehindOverrun => "lookbehind overrun", Error::LookbehindOverrun => "lookbehind overrun",
@ -82,9 +82,7 @@ impl Error {
} }
impl core::fmt::Display for Error { impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.write_str(self.as_str()) }
write!(f, "{}", self.as_str())
}
} }
impl core::error::Error for Error {} impl core::error::Error for Error {}
@ -126,6 +124,4 @@ use pyo3::prelude::*;
#[cfg(feature = "python")] #[cfg(feature = "python")]
#[pymodule(gil_used = false)] #[pymodule(gil_used = false)]
fn lzokay(m: &Bound<'_, PyModule>) -> PyResult<()> { fn lzokay(m: &Bound<'_, PyModule>) -> PyResult<()> { python::lzokay(m) }
python::lzokay(m)
}