An odd error spawned from a first pass at a flutter-rust bridge.. that is graphical front end for instances of rust api.
The cargo build --release
works fine.. this is a simple pull from the current main safe_network code.
It seems that flutter build linux
uses cmake; so, perhaps this is providing a different perspective on the code?.. That looks to be the same as https://crates.io/crates/cmake
I'm not expecting you will reproduce this - there's a bit of work setting it up but hoping those familiar with the code, can make sense of what the error below suggests..
$ flutter build linux
💪 Building with sound null safety 💪
Compiling sn_api v0.75.3 (/mnt/vault/flutter/safe/native)
error[E0277]: a value of type `Vec<(std::string::String, std::option::Option<sn_dbc::PublicKey>)>` cannot be built from an iterator over elements of type `&(std::string::String, std::option::Option<sn_dbc::PublicKey>)`
--> src/safe_network/sn_api/src/app/wallet.rs:290:17
|
290 | / [(amount.to_string(), owner_public_key)]
291 | | .into_iter()
| |________________________________^ value of type `Vec<(std::string::String, std::option::Option<sn_dbc::PublicKey>)>` cannot be built from `std::iter::Iterator<Item=&(std::string::String, std::option::Option<sn_dbc::PublicKey>)>`
292 | .collect(),
| ------- required by a bound introduced by this call
|
= help: the trait `FromIterator<&(std::string::String, std::option::Option<sn_dbc::PublicKey>)>` is not implemented for `Vec<(std::string::String, std::option::Option<sn_dbc::PublicKey>)>`
= help: the trait `FromIterator<T>` is implemented for `Vec<T>`
note: required by a bound in `std::iter::Iterator::collect`
--> /mnt/vault/dev-tools/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:1832:19
|
1832 | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::collect`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `sn_api` due to previous error
Building Linux application...
Build process failed
fyi: The basis of this bridge is described at https://blog.logrocket.com/using-flutter-rust-bridge-cross-platform-development/#creating-flutter-rust-bridge-project and then from a core template from git clone https://github.com/Desdaemon/flutter_rust_bridge_template
.. rust in one bit; flutter in another.. and the outputs are notionally apps for all platforms. Worth resolving then for that interest.