Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance usize and isize #2008

Merged
merged 20 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading