mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix format and clippy warnings
This commit is contained in:
@ -18,7 +18,9 @@ lazy_static! {
|
||||
static ref FLOWY_SDK: RwLock<Option<Arc<FlowySDK>>> = RwLock::new(None);
|
||||
}
|
||||
|
||||
fn dispatch() -> Arc<EventDispatcher> { FLOWY_SDK.read().as_ref().unwrap().dispatcher() }
|
||||
fn dispatch() -> Arc<EventDispatcher> {
|
||||
FLOWY_SDK.read().as_ref().unwrap().dispatcher()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn init_sdk(path: *mut c_char) -> i64 {
|
||||
@ -85,13 +87,13 @@ async fn post_to_flutter(response: EventResponse, port: i64) {
|
||||
{
|
||||
Ok(_success) => {
|
||||
log::trace!("[FFI]: Post data to dart success");
|
||||
},
|
||||
}
|
||||
Err(e) => {
|
||||
if let Some(msg) = e.downcast_ref::<&str>() {
|
||||
log::error!("[FFI]: {:?}", msg);
|
||||
} else {
|
||||
log::error!("[FFI]: allo_isolate post panic");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,5 +22,7 @@ impl FFIRequest {
|
||||
}
|
||||
|
||||
impl std::convert::From<FFIRequest> for ModuleRequest {
|
||||
fn from(ffi_request: FFIRequest) -> Self { ModuleRequest::new(ffi_request.event).payload(ffi_request.payload) }
|
||||
fn from(ffi_request: FFIRequest) -> Self {
|
||||
ModuleRequest::new(ffi_request.event).payload(ffi_request.payload)
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,15 @@ use lib_dispatch::prelude::{EventResponse, Payload, StatusCode};
|
||||
|
||||
#[derive(ProtoBuf_Enum, Clone, Copy)]
|
||||
pub enum FFIStatusCode {
|
||||
Ok = 0,
|
||||
Err = 1,
|
||||
Ok = 0,
|
||||
Err = 1,
|
||||
Internal = 2,
|
||||
}
|
||||
|
||||
impl std::default::Default for FFIStatusCode {
|
||||
fn default() -> FFIStatusCode { FFIStatusCode::Ok }
|
||||
fn default() -> FFIStatusCode {
|
||||
FFIStatusCode::Ok
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
|
Reference in New Issue
Block a user