Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Commit

Permalink
Applied xayn- renamings from dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
rustonaut committed Dec 14, 2021
1 parent 876fe96 commit e422f0e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 1 addition & 2 deletions async-bindgen-derive/src/generate/dart_glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ pub(crate) fn generate_dart_api_init(api_name: &Ident) -> TokenStream {
/// `NativeApi.initializeApiDLData`.
#[no_mangle]
pub unsafe extern "C" fn #init_name(init_data: *mut ::std::ffi::c_void) -> u8 {
let res = unsafe { ::dart_api_dl::initialize_dart_api_dl(init_data) };
res.is_ok() as u8
unsafe { ::async_bindgen::dart::initialize_dart_api_dl(init_data) }
}
}
}
14 changes: 13 additions & 1 deletion async-bindgen/src/dart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@ use std::future::Future;
use xayn_dart_api_dl::{
cobject::{OwnedCObject, TypedData},
ports::SendPort,
DartRuntime,
DartRuntime, InitData,
};

use thiserror::Error;
pub use xayn_dart_api_dl::ports::DartPortId;

/// Forwards to [`xayn_dart_api_dl::initialize_dart_api_dl()`].
///
/// Returns `0` if it failed, returns `1` if it succeeded.
///
/// # Safety
///
/// Exact same constraints as the function we forward to.
pub unsafe fn initialize_dart_api_dl(init_data: InitData) -> u8 {
unsafe { xayn_dart_api_dl::initialize_dart_api_dl(init_data).is_ok() as u8 }
}

pub use xayn_dart_api_dl::{initialize_dart_api_dl, ports::DartPortId};

Expand Down
1 change: 0 additions & 1 deletion integration-tests-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2018"

[dependencies]
async-bindgen = "0.1.0"
dart-api-dl="0.3.0"
once_cell = "1.8.0"
thiserror = "1.0.30"

Expand Down

0 comments on commit e422f0e

Please sign in to comment.