Skip to content

Commit

Permalink
Merge branch 'master' into feat/12137
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy authored Jun 3, 2024
2 parents 2748944 + e606b91 commit 5e9241b
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ keywords = ["flutter", "dart", "ffi", "code-generation", "bindings"]
categories = ["development-tools::ffi"]

[workspace.dependencies]
allo-isolate = { version = "0.1.24", features = ["anyhow"] }
allo-isolate = { version = "0.1.25", features = ["anyhow"] }
#allo-isolate = { git = "https://github.com/shekohex/allo-isolate", features = ["anyhow"] }
anyhow = "1.0.64"
chrono = "0.4.23"
Expand Down

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

11 changes: 11 additions & 0 deletions frb_codegen/src/library/codegen/generator/acc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ impl<T> Acc<T> {
}
}

pub fn new_io_web(value: T) -> Acc<T>
where
T: Default + Clone,
{
Acc {
io: value.clone(),
web: value,
..Default::default()
}
}

pub fn new_common(common: T) -> Acc<T>
where
T: Default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ use crate::library::codegen::generator::api_dart::spec_generator::info::ApiDartG

impl<'a> WireDartCodecCstGeneratorEncoderTrait for PrimitiveListWireDartCodecCstGenerator<'a> {
fn generate_encode_func_body(&self) -> Acc<Option<String>> {
if matches!(
self.mir.primitive,
MirTypePrimitive::Isize | MirTypePrimitive::Usize
) {
return Acc::new_io_web(Some(
"throw UnimplementedError('Not implemented in this codec');".to_owned(),
));
}

Acc {
// NOTE Dart code *only* allocates memory. It never *release* memory by itself.
// Instead, Rust receives that pointer and now it is in control of Rust.
Expand Down
4 changes: 2 additions & 2 deletions frb_example/dart_build_rs/rust/Cargo.lock

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

4 changes: 2 additions & 2 deletions frb_example/dart_minimal/rust/Cargo.lock

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

4 changes: 2 additions & 2 deletions frb_example/deliberate_bad/rust/Cargo.lock

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

4 changes: 2 additions & 2 deletions frb_example/flutter_via_create/rust/Cargo.lock

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

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 deletions frb_example/gallery/rust/Cargo.lock

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

4 changes: 2 additions & 2 deletions frb_example/pure_dart/rust/Cargo.lock

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

4 changes: 2 additions & 2 deletions frb_example/pure_dart_pde/rust/Cargo.lock

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

0 comments on commit 5e9241b

Please sign in to comment.