mirror of
https://github.com/zap-proto/rust.git
synced 2026-10-30 15:04:23 +00:00
Two pre-existing CI failures (unrelated to codegen/install-zap): - minrust 1.81: quickcheck 1.1.0 pulls rand 0.10 -> rand_core 0.10.1, whose Cargo.toml requires the edition2024 feature (unstable on Cargo 1.81). Pin quickcheck to =1.0.3 (last version on rand 0.8 / rand_core 0.6.4) — within MSRV, no major bump. Fresh-resolve verified: rand_core 0.10.1 leaves the graph. - formatting: ran 'cargo +nightly fmt --all'; the CI check (--check --unstable-features --error-on-unformatted, nightly) now passes.
17 lines
538 B
Rust
17 lines
538 B
Rust
use fill_random_values::Filler;
|
|
use zap::dynamic_value;
|
|
|
|
zap::generated_code!(pub mod addressbook_zap);
|
|
zap::generated_code!(pub mod fill_zap);
|
|
|
|
pub fn main() {
|
|
let mut message = ::zap::message::Builder::new_default();
|
|
let mut addressbook = message.init_root::<addressbook_zap::address_book::Builder>();
|
|
|
|
let mut filler = Filler::new(::rand::rng(), 10);
|
|
let dynamic: dynamic_value::Builder = addressbook.reborrow().into();
|
|
filler.fill(dynamic.downcast()).unwrap();
|
|
|
|
println!("{:#?}", addressbook.into_reader());
|
|
}
|