From 25347bb8a188ae46b39c9572c65e3af4fdd9c834 Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Sun, 30 Jun 2024 23:03:37 -0700 Subject: [PATCH] Update flutter_rust_bridge --- Makefile | 4 ++-- flutter_rust_bridge.yaml | 2 +- lib/src/rust/api/compressor.dart | 2 +- lib/src/rust/frb_generated.dart | 7 ++++--- lib/src/rust/frb_generated.io.dart | 2 +- lib/src/rust/frb_generated.web.dart | 2 +- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- rust/Cargo.lock | 8 ++++---- rust/Cargo.toml | 2 +- rust/src/frb_generated.io.rs | 4 ++-- rust/src/frb_generated.rs | 26 ++++++++++++++++---------- rust/src/frb_generated.web.rs | 4 ++-- 13 files changed, 38 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index bb6fbae..c3cd25d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ build: build_rust build_gen - flutter build macos + flutter build macos --analyze-size watch: dart run build_runner watch --delete-conflicting-outputs @@ -14,7 +14,7 @@ watch_rust: flutter_rust_bridge_codegen generate --watch update_rust: - cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.0' && flutter_rust_bridge_codegen generate + cargo install 'flutter_rust_bridge_codegen' && flutter_rust_bridge_codegen generate create_dmg: ./scripts/create_dmg.sh diff --git a/flutter_rust_bridge.yaml b/flutter_rust_bridge.yaml index f009f9c..2511bed 100644 --- a/flutter_rust_bridge.yaml +++ b/flutter_rust_bridge.yaml @@ -1,2 +1,2 @@ rust_input: rust/src/api/**/*.rs -dart_output: lib/src/rust \ No newline at end of file +dart_output: lib/src/rust diff --git a/lib/src/rust/api/compressor.dart b/lib/src/rust/api/compressor.dart index 2868cbe..f7118a6 100644 --- a/lib/src/rust/api/compressor.dart +++ b/lib/src/rust/api/compressor.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.39. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/src/rust/frb_generated.dart b/lib/src/rust/frb_generated.dart index 9e3aa9b..505191e 100644 --- a/lib/src/rust/frb_generated.dart +++ b/lib/src/rust/frb_generated.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.39. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -7,7 +7,8 @@ import 'api/compressor.dart'; import 'dart:async'; import 'dart:convert'; import 'frb_generated.dart'; -import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart'; +import 'frb_generated.io.dart' + if (dart.library.js_interop) 'frb_generated.web.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; /// Main entrypoint of the Rust API @@ -54,7 +55,7 @@ class RustLib extends BaseEntrypoint { kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.0.0-dev.39'; + String get codegenVersion => '2.0.0'; @override int get rustContentHash => -1541159124; diff --git a/lib/src/rust/frb_generated.io.dart b/lib/src/rust/frb_generated.io.dart index c7dc8f2..3363eea 100644 --- a/lib/src/rust/frb_generated.io.dart +++ b/lib/src/rust/frb_generated.io.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.39. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field diff --git a/lib/src/rust/frb_generated.web.dart b/lib/src/rust/frb_generated.web.dart index b4bc3f7..a3f7e1d 100644 --- a/lib/src/rust/frb_generated.web.dart +++ b/lib/src/rust/frb_generated.web.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.39. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field diff --git a/pubspec.lock b/pubspec.lock index 2778dfa..154b645 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -391,10 +391,10 @@ packages: dependency: "direct main" description: name: flutter_rust_bridge - sha256: ee0d9798156ba523ca24bfb690efd15614f823685df270447c480dd5923d9a0b + sha256: f703c4b50e253e53efc604d50281bbaefe82d615856f8ae1e7625518ae252e98 url: "https://pub.dev" source: hosted - version: "2.0.0-dev.39" + version: "2.0.0" flutter_test: dependency: "direct dev" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index c8ea46b..ea46e71 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: window_manager: ^0.3.8 rust_builder: path: rust_builder - flutter_rust_bridge: 2.0.0-dev.39 + flutter_rust_bridge: ^2.0.0 file_selector: ^1.0.3 signals: ^5.0.0 open_file_macos: ^0.0.1 diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 965d714..1f44d92 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -573,9 +573,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.39" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c9a3d358c2df51ac5ab05440334a63d7e2ce3229ca05d285769498bfe7fb8d" +checksum = "033e831e28f1077ceae3490fb6d093dfdefefd09c5c6e8544c6579effe7e814f" dependencies = [ "allo-isolate", "android_logger", @@ -600,9 +600,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.39" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c73c8b391f3c0aed00493871aee6541c03d117d553fa5c121f126dfbbad5157" +checksum = "0217fc4b7131b52578be60bbe38c76b3edfc2f9fecab46d9f930510f40ef9023" dependencies = [ "hex", "md-5", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 517c19f..66a7b1e 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" crate-type = ["cdylib", "staticlib"] [dependencies] -flutter_rust_bridge = "=2.0.0-dev.39" +flutter_rust_bridge = "=2.0.0" image = "^0.25" libcaesium = { git = "https://github.com/Lymphatus/libcaesium.git", tag = "0.15.5" } diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index 1784fec..44a9b90 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -1,11 +1,11 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.39. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports use super::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::{transform_result_dco, Lockable}; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index d24a47e..48de2bb 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.39. +// Generated by `flutter_rust_bridge`@ 2.0.0. #![allow( non_camel_case_types, @@ -16,13 +16,17 @@ clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, - clippy::let_unit_value + clippy::let_unit_value, + clippy::deref_addrof, + clippy::explicit_auto_deref, + clippy::borrow_deref_ref, + clippy::needless_borrow )] // Section: imports use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::{transform_result_dco, Lockable}; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -32,7 +36,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueMoi, default_rust_auto_opaque = RustAutoOpaqueMoi, ); -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.39"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0"; pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -1541159124; // Section: executor @@ -65,10 +69,11 @@ fn wire__crate__api__compressor__init_app_impl( flutter_rust_bridge::for_generated::SseDeserializer::new(message); deserializer.end(); move |context| { - transform_result_sse((move || { - Result::<_, ()>::Ok({ + transform_result_sse::<_, ()>((move || { + let output_ok = Result::<_, ()>::Ok({ crate::api::compressor::init_app(); - }) + })?; + Ok(output_ok) })()) } }, @@ -102,12 +107,13 @@ fn wire__crate__api__compressor__process_img_impl( ::sse_decode(&mut deserializer); deserializer.end(); move |context| { - transform_result_sse((move || { - Result::<_, ()>::Ok(crate::api::compressor::process_img( + transform_result_sse::<_, ()>((move || { + let output_ok = Result::<_, ()>::Ok(crate::api::compressor::process_img( api_path, api_out_path, api_parameters, - )) + ))?; + Ok(output_ok) })()) } }, diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs index bc66047..7ccbbf3 100644 --- a/rust/src/frb_generated.web.rs +++ b/rust/src/frb_generated.web.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.39. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports @@ -7,7 +7,7 @@ use super::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::wasm_bindgen; use flutter_rust_bridge::for_generated::wasm_bindgen::prelude::*; -use flutter_rust_bridge::for_generated::{transform_result_dco, Lockable}; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate