Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Dec 1, 2023
1 parent 9500223 commit 3c313be
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ fn generate_static_checks(types: &[IrType], context: WireRustGeneratorContext) -
}

let mut lines = vec![];
lines.push("#[allow(clippy::unnecessary_literal_unwrap)]".to_owned());
lines.push("const _: fn() = || {".to_owned());
lines.extend(raw);
lines.push("};".to_owned());
Expand Down
136 changes: 0 additions & 136 deletions frb_example/flutter_via_integrate/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frb_example/pure_dart/rust/src/frb_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8021,6 +8021,7 @@ pub struct mirror_Sequences(crate::api::pseudo_manual::mirror_twin_sync::Sequenc

// Section: static_checks

#[allow(clippy::unnecessary_literal_unwrap)]
const _: fn() = || {
{
let ApplicationEnv =
Expand Down
4 changes: 2 additions & 2 deletions frb_rust/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl<EH: ErrorHandler + Sync> Executor for ThreadPoolExecutor<EH> {
let eh = self.error_handler;
let eh2 = self.error_handler;

rust_async::spawn((|| async move {
rust_async::spawn(async move {
let WrapInfo { port, mode, .. } = wrap_info;
let port2 = port.as_ref().cloned();

Expand Down Expand Up @@ -370,7 +370,7 @@ impl<EH: ErrorHandler + Sync> Executor for ThreadPoolExecutor<EH> {
if let Err(error) = thread_result {
eh.handle_error(port.expect("(worker) eh"), Error::Panic(error));
}
})());
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion frb_rust/src/rust_async/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ lazy_static! {
static ref ASYNC_RUNTIME: Mutex<Runtime> = Mutex::new(Runtime::new().unwrap());
}

pub(crate) fn spawn<F>(future: F) -> JoinHandle<F::Output>
pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static,
Expand Down
2 changes: 1 addition & 1 deletion frb_rust/src/rust_async/web.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::future::Future;
use wasm_bindgen_futures::spawn_local;

pub(crate) fn spawn<F>(future: F)
pub fn spawn<F>(future: F)
where
F: Future<Output = ()> + 'static,
{
Expand Down

0 comments on commit 3c313be

Please sign in to comment.