Skip to content

Commit

Permalink
bump pyo3
Browse files Browse the repository at this point in the history
  • Loading branch information
zaaarf committed Feb 15, 2025
1 parent 3ca0f7c commit 2126cfe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ mlua = { version = "0.10", features = ["module", "serialize", "error-send"], opt

# glue (js)
napi = { version = "2.16", features = ["full"], optional = true }
napi-derive = { version="2.16", optional = true}
napi-derive = { version="2.16", optional = true }

# glue (python)
pyo3 = { version = "0.22", features = ["extension-module", "multiple-pymethods"], optional = true}
pyo3 = { version = "0.23", features = ["extension-module", "multiple-pymethods"], optional = true}

# extra
async-trait = { version = "0.1", optional = true }
Expand Down
5 changes: 3 additions & 2 deletions src/api/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
use std::fmt::{Debug, Display};

use serde::Serialize;

/// Configuration struct for the `codemp` client.
///
/// `username` and `password` are required fields, everything else is optional.
Expand Down Expand Up @@ -67,7 +65,10 @@ impl Config {
}

#[derive(Clone, Default)]
#[repr(transparent)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize), serde(transparent))]
#[cfg_attr(feature = "py", derive(pyo3::IntoPyObject), pyo3(transparent))]
#[cfg_attr(feature = "js", napi(transparent))]
pub struct Password(String);

impl From<String> for Password {
Expand Down
5 changes: 4 additions & 1 deletion src/ffi/java/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ macro_rules! null_check {

pub(crate) use null_check;

use crate::api::config::Password;

impl jni_toolbox::JniToolboxError for crate::errors::ConnectionError {
fn jclass(&self) -> String {
match self {
Expand Down Expand Up @@ -336,7 +338,8 @@ impl<'j> jni_toolbox::FromJava<'j> for crate::api::Config {
if jfield.is_null() {
return Err(jni::errors::Error::NullPtr("Password can never be null!"));
}
unsafe { env.get_string_unchecked(&jfield.into()) }?.into()
let s: String = unsafe { env.get_string_unchecked(&jfield.into()) }?.into();
Password::from(s)
};

let host = {
Expand Down
4 changes: 2 additions & 2 deletions src/ffi/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Selection {
buffer: String,
kwds: Option<&Bound<'_, PyDict>>,
) -> PyResult<Self> {
if let Some(kwds) = kwds {
if let Some(_kwds) = kwds {
Ok(Self {
start_row,
start_col,
Expand Down Expand Up @@ -277,7 +277,7 @@ impl TextChange {
content: String,
kwds: Option<&Bound<'_, PyDict>>,
) -> PyResult<Self> {
if let Some(kwds) = kwds {
if let Some(_kwds) = kwds {
Ok(Self {
start_idx: start,
end_idx: end,
Expand Down

0 comments on commit 2126cfe

Please sign in to comment.