Skip to content

Commit bf5a06a

Browse files
authored
Bump dependencies (#66)
1 parent 3912388 commit bf5a06a

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed

Cargo.lock

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ name = "neo4j_rust_ext"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
pyo3 = "0.25.1"
13+
pyo3 = "0.26.0"

changelog.d/66.improve.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump dependency PyO3 (Rust binding for Python) from `0.25.1` to `0.26.0`<ISSUES_LIST>.

src/codec/packstream.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub(super) fn init_module(m: &Bound<PyModule>, name: &str) -> PyResult<()> {
4343
pub struct Structure {
4444
tag: u8,
4545
#[pyo3(get)]
46-
fields: Vec<PyObject>,
46+
fields: Vec<Py<PyAny>>,
4747
}
4848

4949
impl Structure {
@@ -85,7 +85,7 @@ impl Structure {
8585
#[new]
8686
#[pyo3(signature = (tag, *fields))]
8787
#[pyo3(text_signature = "(tag, *fields)")]
88-
fn new(tag: &[u8], fields: Vec<PyObject>) -> PyResult<Self> {
88+
fn new(tag: &[u8], fields: Vec<Py<PyAny>>) -> PyResult<Self> {
8989
if tag.len() != 1 {
9090
return Err(PyErr::new::<PyValueError, _>("tag must be a single byte"));
9191
}
@@ -109,7 +109,7 @@ impl Structure {
109109
Ok(format!("Structure({args})"))
110110
}
111111

112-
fn __richcmp__(&self, other: &Self, op: CompareOp, py: Python<'_>) -> PyResult<PyObject> {
112+
fn __richcmp__(&self, other: &Self, op: CompareOp, py: Python<'_>) -> PyResult<Py<PyAny>> {
113113
Ok(match op {
114114
CompareOp::Eq => self.eq(other, py)?.into_py_any(py)?,
115115
CompareOp::Ne => (!self.eq(other, py)?).into_py_any(py)?,
@@ -121,11 +121,11 @@ impl Structure {
121121
self.fields.len()
122122
}
123123

124-
fn __getitem__(&self, index: isize, py: Python<'_>) -> PyResult<PyObject> {
124+
fn __getitem__(&self, index: isize, py: Python<'_>) -> PyResult<Py<PyAny>> {
125125
Ok(self.fields[self.compute_index(index)?].clone_ref(py))
126126
}
127127

128-
fn __setitem__(&mut self, index: isize, value: PyObject) -> PyResult<()> {
128+
fn __setitem__(&mut self, index: isize, value: Py<PyAny>) -> PyResult<()> {
129129
let index = self.compute_index(index)?;
130130
self.fields[index] = value;
131131
Ok(())

src/codec/packstream/v1/pack.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ use super::{
3232

3333
#[derive(Debug)]
3434
struct TypeMappings {
35-
none_values: Vec<PyObject>,
36-
true_values: Vec<PyObject>,
37-
false_values: Vec<PyObject>,
38-
int_types: PyObject,
39-
float_types: PyObject,
40-
sequence_types: PyObject,
41-
mapping_types: PyObject,
42-
bytes_types: PyObject,
35+
none_values: Vec<Py<PyAny>>,
36+
true_values: Vec<Py<PyAny>>,
37+
false_values: Vec<Py<PyAny>>,
38+
int_types: Py<PyAny>,
39+
float_types: Py<PyAny>,
40+
sequence_types: Py<PyAny>,
41+
mapping_types: Py<PyAny>,
42+
bytes_types: Py<PyAny>,
4343
}
4444

4545
impl TypeMappings {
@@ -274,7 +274,7 @@ impl<'a> PackStreamEncoder<'a> {
274274
fn write_exact_value(
275275
&mut self,
276276
value: &Bound<PyAny>,
277-
values: &[PyObject],
277+
values: &[Py<PyAny>],
278278
bytes: &[u8],
279279
) -> PyResult<bool> {
280280
for v in values {

src/codec/packstream/v1/unpack.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub(super) fn unpack(
3232
bytes: Bound<PyByteArray>,
3333
idx: usize,
3434
hydration_hooks: Option<Bound<PyDict>>,
35-
) -> PyResult<(PyObject, usize)> {
35+
) -> PyResult<(Py<PyAny>, usize)> {
3636
let py = bytes.py();
3737
let mut decoder = PackStreamDecoder::new(py, bytes, idx, hydration_hooks);
3838
let result = decoder.read()?;
@@ -61,12 +61,12 @@ impl<'a> PackStreamDecoder<'a> {
6161
}
6262
}
6363

64-
fn read(&mut self) -> PyResult<PyObject> {
64+
fn read(&mut self) -> PyResult<Py<PyAny>> {
6565
let marker = self.read_byte()?;
6666
self.read_value(marker)
6767
}
6868

69-
fn read_value(&mut self, marker: u8) -> PyResult<PyObject> {
69+
fn read_value(&mut self, marker: u8) -> PyResult<Py<PyAny>> {
7070
let high_nibble = marker & 0xF0;
7171

7272
Ok(match marker {
@@ -141,7 +141,7 @@ impl<'a> PackStreamDecoder<'a> {
141141
})
142142
}
143143

144-
fn read_list(&mut self, length: usize) -> PyResult<PyObject> {
144+
fn read_list(&mut self, length: usize) -> PyResult<Py<PyAny>> {
145145
if length == 0 {
146146
return Ok(PyList::empty(self.py).into_any().unbind());
147147
}
@@ -152,7 +152,7 @@ impl<'a> PackStreamDecoder<'a> {
152152
items.into_py_any(self.py)
153153
}
154154

155-
fn read_string(&mut self, length: usize) -> PyResult<PyObject> {
155+
fn read_string(&mut self, length: usize) -> PyResult<Py<PyAny>> {
156156
if length == 0 {
157157
return "".into_py_any(self.py);
158158
}
@@ -174,11 +174,11 @@ impl<'a> PackStreamDecoder<'a> {
174174
data.into_py_any(self.py)
175175
}
176176

177-
fn read_map(&mut self, length: usize) -> PyResult<PyObject> {
177+
fn read_map(&mut self, length: usize) -> PyResult<Py<PyAny>> {
178178
if length == 0 {
179179
return Ok(PyDict::new(self.py).into_any().unbind());
180180
}
181-
let mut key_value_pairs: Vec<(PyObject, PyObject)> = Vec::with_capacity(length);
181+
let mut key_value_pairs: Vec<(Py<PyAny>, Py<PyAny>)> = Vec::with_capacity(length);
182182
for _ in 0..length {
183183
let len = self.read_string_length()?;
184184
let key = self.read_string(len)?;
@@ -188,7 +188,7 @@ impl<'a> PackStreamDecoder<'a> {
188188
Ok(key_value_pairs.into_py_dict(self.py)?.into())
189189
}
190190

191-
fn read_bytes(&mut self, length: usize) -> PyResult<PyObject> {
191+
fn read_bytes(&mut self, length: usize) -> PyResult<Py<PyAny>> {
192192
if length == 0 {
193193
return Ok(PyBytes::new(self.py, &[]).into_any().unbind());
194194
}
@@ -208,7 +208,7 @@ impl<'a> PackStreamDecoder<'a> {
208208
Ok(PyBytes::new(self.py, &data).into_any().unbind())
209209
}
210210

211-
fn read_struct(&mut self, length: usize) -> PyResult<PyObject> {
211+
fn read_struct(&mut self, length: usize) -> PyResult<Py<PyAny>> {
212212
let tag = self.read_byte()?;
213213
let mut fields = Vec::with_capacity(length);
214214
for _ in 0..length {

0 commit comments

Comments
 (0)