Skip to content

Commit

Permalink
Fix build with latest napi
Browse files Browse the repository at this point in the history
JsExternal is now marked as deprecated, which makes our warning-are-errors CI fail. Use External<T> instead.
  • Loading branch information
tronical committed Jun 25, 2024
1 parent 3d52486 commit a0db821
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/node/src/types/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::rc::Rc;
use i_slint_compiler::langtype::Type;
use i_slint_core::model::{Model, ModelNotify, ModelRc};
use napi::{bindgen_prelude::*, JsSymbol};
use napi::{Env, JsExternal, JsFunction, JsNumber, JsObject, JsUnknown, Result, ValueType};
use napi::{Env, JsFunction, JsNumber, JsObject, JsUnknown, Result, ValueType};

use crate::{to_js_unknown, to_value, RefCountedReference};

Expand Down Expand Up @@ -36,8 +36,8 @@ pub(crate) fn js_into_rust_model(
)
})
})
.and_then(|shared_model_notify: JsExternal| {
env.get_value_external::<SharedModelNotify>(&shared_model_notify).cloned()
.map(|shared_model_notify: External<SharedModelNotify>| {
shared_model_notify.as_ref().clone()
})?;
Ok(Rc::new(JsModel {
shared_model_notify,
Expand Down

0 comments on commit a0db821

Please sign in to comment.