mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-28 09:24:41 +00:00
Fix tricky Rust error which turned out to just needing to use an actual py
```
error[E0277]: the trait bound `std::vec::Vec<T>: pyo3::FromPyObject<'_, '_>` is not satisfied
--> rust/src/storage/db/python_db_pool.rs:228:30
|
228 | Ok(fetch_fn.call0()?.extract()?)
| ^^^^^^^ the trait `pyo3::FromPyObject<'_, '_>` is not implemented for `std::vec::Vec<T>`
|
note: required by a bound in `pyo3::types::PyAnyMethods::extract`
--> /home/eric/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/pyo3-0.28.3/src/types/any.rs:881:12
|
879 | fn extract<'a, T>(&'a self) -> Result<T, T::Error>
| ------- required by a bound in this associated function
880 | where
881 | T: FromPyObject<'a, 'py>;
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `PyAnyMethods::extract`
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
223 | ) -> anyhow::Result<Vec<T>> where std::vec::Vec<T>: pyo3::FromPyObject<'_, '_> {
| ++++++++++++++++++++++++++++++++++++++++++++++++++
```
This commit is contained in:
@@ -224,7 +224,7 @@ impl LoggingTransactionWrapper {
|
||||
let fetch_fn = self
|
||||
.logging_transaction_py
|
||||
.bind(py)
|
||||
.getattr(intern!(self.logging_transaction_py.py(), "fetchall"))?;
|
||||
.getattr(intern!(py, "fetchall"))?;
|
||||
Ok(fetch_fn.call0()?.extract()?)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user