From bd2250b6c97f87987d6c861b2030ba3d25e94a98 Mon Sep 17 00:00:00 2001 From: SoLongAndThanksForAllThePizza <103753680+SoLongAndThanksForAllThePizza@users.noreply.github.com> Date: Wed, 25 May 2022 20:50:32 +0800 Subject: [PATCH 1/2] fix unchanged mobile_ffi.rs --- build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index aaf0858c1..bad00457f 100644 --- a/build.rs +++ b/build.rs @@ -64,11 +64,11 @@ fn install_oboe() { fn gen_flutter_rust_bridge() { // Tell Cargo that if the given file changes, to rerun this build script. - println!("cargo:rerun-if-changed=src/mobile_ffi.rs"); + println!("cargo:rerun-if-changed=src/flutter_ffi.rs"); // settings for fbr_codegen let opts = lib_flutter_rust_bridge_codegen::Opts { // Path of input Rust code - rust_input: "src/mobile_ffi.rs".to_string(), + rust_input: "src/flutter_ffi.rs".to_string(), // Path of output generated Dart code dart_output: "flutter/lib/generated_bridge.dart".to_string(), // for other options lets use default From 537918674ead1eb11a1c3234ce2ddf6003b25135 Mon Sep 17 00:00:00 2001 From: SoLongAndThanksForAllThePizza <103753680+SoLongAndThanksForAllThePizza@users.noreply.github.com> Date: Wed, 25 May 2022 20:57:25 +0800 Subject: [PATCH 2/2] fix unchanged mobile --- src/client/file_trait.rs | 2 +- src/flutter_ffi.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/file_trait.rs b/src/client/file_trait.rs index be790b035..5dc4cd786 100644 --- a/src/client/file_trait.rs +++ b/src/client/file_trait.rs @@ -24,7 +24,7 @@ pub trait FileManager: Interface { #[cfg(any(target_os = "android", target_os = "ios"))] fn read_dir(&self,path: &str, include_hidden: bool) -> String { - use crate::mobile::make_fd_to_json; + use crate::flutter::make_fd_to_json; match fs::read_dir(&fs::get_path(path), include_hidden){ Ok(fd) => make_fd_to_json(fd), Err(_)=>"".into() diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index ec6ef9082..d2a0eddef 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -1,6 +1,6 @@ use crate::client::file_trait::FileManager; -use crate::mobile::connection_manager::{self, get_clients_length, get_clients_state}; -use crate::mobile::{self, make_fd_to_json, Session}; +use crate::flutter::connection_manager::{self, get_clients_length, get_clients_state}; +use crate::flutter::{self, make_fd_to_json, Session}; use flutter_rust_bridge::{StreamSink, ZeroCopyBuffer}; use hbb_common::ResultType; use hbb_common::{ @@ -37,12 +37,12 @@ fn initialize(app_dir: &str) { } pub fn start_event_stream(s: StreamSink) -> ResultType<()> { - let _ = mobile::EVENT_STREAM.write().unwrap().insert(s); + let _ = flutter::EVENT_STREAM.write().unwrap().insert(s); Ok(()) } pub fn start_rgba_stream(s: StreamSink>>) -> ResultType<()> { - let _ = mobile::RGBA_STREAM.write().unwrap().insert(s); + let _ = flutter::RGBA_STREAM.write().unwrap().insert(s); Ok(()) }