Skip to content

Commit

Permalink
PyO3: migrate to Bound smart pointer for `src/rust/engine/src/exter…
Browse files Browse the repository at this point in the history
…ns/nailgun.rs` (#21471)

Migrate to the `Bound` smart pointer instead of `&PyAny` (and related reference types) in `src/rust/engine/src/externs/nailgun.rs`. See the [PyO3 migration guide](https://pyo3.rs/main/migration#migrating-from-the-gil-refs-api-to-boundt) for details.
  • Loading branch information
tdyas authored Oct 2, 2024
1 parent e0f0083 commit ccd00a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rust/engine/src/externs/nailgun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ struct PyNailgunClient {
#[pymethods]
impl PyNailgunClient {
#[new]
fn __new__(port: u16, py_executor: &PyExecutor) -> Self {
fn __new__(port: u16, py_executor: &Bound<'_, PyExecutor>) -> Self {
Self {
port,
executor: py_executor.0.clone(),
executor: py_executor.borrow().0.clone(),
}
}

fn execute(
&self,
command: String,
args: Vec<String>,
env: &PyDict,
env: &Bound<'_, PyDict>,
py: Python,
) -> PyResult<i32> {
use nailgun::NailgunClientError;
Expand Down

0 comments on commit ccd00a2

Please sign in to comment.