Skip to content

Commit b5da975

Browse files
authored
Merge pull request #166 from projectsyn/renovate/pyo3-0.x
Update Rust crate pyo3 to v0.25.0
2 parents 350f7b9 + 0afd15a commit b5da975

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fancy-regex = "0.14.0"
2222
glob = "0.3.2"
2323
indexmap = "2.2.6"
2424
nom = "7.1.3"
25-
pyo3 = { version = "=0.24.2", features = ["chrono"] }
25+
pyo3 = { version = "=0.25.0", features = ["chrono"] }
2626
rayon = "1.10.0"
2727
regex = "1.10.4"
2828
serde = { version = "1.0.200", features = ["derive"] }

src/node/nodeinfo.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use anyhow::{anyhow, Result};
2+
use chrono::offset::FixedOffset;
23
use chrono::offset::Local;
34
use chrono::DateTime;
45
use pyo3::prelude::*;
@@ -29,8 +30,11 @@ pub struct NodeInfoMeta {
2930
#[pyo3(get)]
3031
pub environment: String,
3132
#[pyo3(get)]
32-
/// `chrono::DateTime<Local>` at which we started rendering the data for the node
33-
render_time: DateTime<Local>,
33+
/// `chrono::DateTime<FixedOffset>` at which we started rendering the data for the node
34+
///
35+
/// When creating the value we convert a `DateTime<Local>` to a `DateTime<FixedOffset> since
36+
/// PyO3 can't convert `DateTime<Local>` to a `PyDateTime` anymore.
37+
render_time: DateTime<FixedOffset>,
3438
}
3539

3640
impl Default for NodeInfoMeta {
@@ -55,7 +59,7 @@ impl NodeInfoMeta {
5559
name: name.into(),
5660
uri: uri.into(),
5761
environment: environment.into(),
58-
render_time: Local::now(),
62+
render_time: Local::now().into(),
5963
}
6064
}
6165

0 commit comments

Comments
 (0)