Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
A.Shpak committed Jan 1, 2025
1 parent 67784ed commit 2664c41
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "epyxid"
version = "0.3.2"
version = "0.3.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -9,7 +9,7 @@ name = "epyxid"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.22.6", features = ["extension-module"] }
pyo3 = { version = "0.23.3", features = ["extension-module"] }
xid = "1.1.1"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires-python = ">=3.8"
authors = [
{name = "Aleksandr Shpak", email = "shpaker@gmail.com"},
]
version = "0.3.2"
version = "0.3.3"
readme = "README.md"
license = { file = "LICENSE.txt" }
keywords = [
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::errors::XIDError;
use crate::utils::{xid_create, xid_from_bytes, xid_from_str};
use crate::wrapper::XID;

const PY_MODULE_VERSION: &str = "0.3.2";
const PY_MODULE_VERSION: &str = "0.3.3";

mod errors;
mod utils;
Expand All @@ -20,7 +20,7 @@ fn epyxid(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(xid_create, m)?)?;
m.add_function(wrap_pyfunction!(xid_from_str, m)?)?;
m.add_function(wrap_pyfunction!(xid_from_bytes, m)?)?;
m.add("XIDError", py.get_type_bound::<XIDError>())?;
m.add("XIDError", py.get_type::<XIDError>())?;
m.add("__version__", PY_MODULE_VERSION)?;
Ok(())
}
6 changes: 3 additions & 3 deletions src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl XID {
}

fn as_bytes<'p>(&self, _py: Python<'p>) -> Bound<'p, PyBytes> {
PyBytes::new_bound(_py, self.0.as_bytes())
PyBytes::new(_py, self.0.as_bytes())
}

fn to_str(&self) -> String {
Expand All @@ -40,7 +40,7 @@ impl XID {

#[getter]
fn machine<'p>(&self, _py: Python<'p>) -> Bound<'p, PyBytes> {
PyBytes::new_bound(_py, &self.0.machine())
PyBytes::new(_py, &self.0.machine())
}

#[getter]
Expand All @@ -52,7 +52,7 @@ impl XID {
fn time<'p>(&self, _py: Python<'p>) -> PyResult<Bound<'p, PyDateTime>> {
let raw = self.0.as_bytes();
let unix_ts = u32::from_be_bytes([raw[0], raw[1], raw[2], raw[3]]);
PyDateTime::from_timestamp_bound(_py, unix_ts as f64, None)
PyDateTime::from_timestamp(_py, unix_ts as f64, None)
}

#[getter]
Expand Down

0 comments on commit 2664c41

Please sign in to comment.