Use bon for entry builder #38

Merged
AljoschaMeyer merged 3 commits from aecsocket/willow_rs:feat/bon into main 2026-04-07 20:37:03 +02:00
Contributor

Removes willow_data_model's EntryBuilder and makes it derived by bon instead. Keeps the custom methods like payload, async_payload. Adjusts willow25's EntryBuilder to match.

I'm not a fan of how willow25 wraps the EntryBuilder, since it means we have to manually redefine the builder setter fns, but I don't think there's much we can do.

The payload and payload_async fns convert a usize to a u64 by as-casting, which is potentially dangerous. I've kept it in but as a panicking u64::try_from().expect - imo these fns should return Results.

Removes `willow_data_model`'s `EntryBuilder` and makes it derived by `bon` instead. Keeps the custom methods like `payload`, `async_payload`. Adjusts `willow25`'s `EntryBuilder` to match. I'm not a fan of how willow25 wraps the EntryBuilder, since it means we have to manually redefine the builder setter fns, but I don't think there's much we can do. The `payload` and `payload_async` fns convert a usize to a u64 by `as`-casting, which is potentially dangerous. I've kept it in but as a panicking `u64::try_from().expect` - imo these fns should return `Result`s.

PR looks good, I'm happy to merge this after seeing all tests pass =)

The payload and payload_async fns convert a usize to a u64 by as-casting, which is potentially dangerous. I've kept it in but as a panicking u64::try_from().expect - imo these fns should return Results.

Opened a dedicated issue for this one: #40

PR looks good, I'm happy to merge this after seeing all tests pass =) > The payload and payload_async fns convert a usize to a u64 by as-casting, which is potentially dangerous. I've kept it in but as a panicking u64::try_from().expect - imo these fns should return Results. Opened a dedicated issue for this one: https://codeberg.org/worm-blossom/willow_rs/issues/40

@aecsocket there are a bunch of doc tests that now fail, could you fix those?

@aecsocket there are a bunch of doc tests that now fail, could you fix those?
Author
Contributor

Fixed doctests

Fixed doctests

Nice, thank you. Looks good now!

Nice, thank you. Looks good now!
Sign in to join this conversation.
No description provided.