You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on https://github.com/fzyzcjy/flutter_rust_bridge, cargo expand is used to expand user source code. Currently, only one call is made, and later the modules of corresponding files are extracted hackily.
However, it seems not very trivial to correctly extract what code belongs to a file (module). For example, if we simply count matching brackets, then we will fail when the code contains something like let a = "{"; because that bracket does not match.
Cargo expand does support expanding a single item, which works great. However, it seems that the time to expand that single item is the same as expanding a whole crate. Since flutter_rust_bridge needs to scan all files of the crate, it will call cargo expand (e.g.) hundreds of times, which is super slow, so this approach may not be super ideal.
Therefore, I would appreciate it if I could know how to run cargo-expand once, and then get code for each file(module) separately?
The text was updated successfully, but these errors were encountered:
Hi, thanks for the wonderful tool!
When working on https://github.com/fzyzcjy/flutter_rust_bridge, cargo expand is used to expand user source code. Currently, only one call is made, and later the modules of corresponding files are extracted hackily.
However, it seems not very trivial to correctly extract what code belongs to a file (module). For example, if we simply count matching brackets, then we will fail when the code contains something like
let a = "{";
because that bracket does not match.Cargo expand does support expanding a single item, which works great. However, it seems that the time to expand that single item is the same as expanding a whole crate. Since flutter_rust_bridge needs to scan all files of the crate, it will call cargo expand (e.g.) hundreds of times, which is super slow, so this approach may not be super ideal.
Therefore, I would appreciate it if I could know how to run cargo-expand once, and then get code for each file(module) separately?
The text was updated successfully, but these errors were encountered: