fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
4.12k stars 283 forks source link

[Bug] Subwire not properly generated #840

Closed alexthe2 closed 1 year ago

alexthe2 commented 1 year ago

Describe the bug

I believe the wire for Boxed Object's is not properly generated, as for this code:

pub struct BasisSummaryV1 {
   ...
    // The time_start of the summary as seconds since the epoch in UTC
    pub time_start: Box<RustyTime>,

}

will be translated to:

wireObj.time_start = api2wire_rusty_time(apiObj.timeStart);
...

however, the api2wire_rusty_time is not being generated

Codegen logs with RUST_LOG=debug environment variable

The code is sadly private 😢, but I'll try to fix the bug and/or create a MRE.

To Reproduce

No response

Expected behavior

No response

Generated binding code

No response

OS

No response

Version of flutter_rust_bridge_codegen

No response

Flutter info

No response

Version of clang++

No response

Version of ffigen

No response

Additional context

No response

alexthe2 commented 1 year ago

Actually, it's the opposite. The bug occurs when you don't box: pub time_start: RustyTime,, for now one can fix it by simply Boxing the value

alexthe2 commented 1 year ago

I didn't read it in the doc, now I saw it

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.