Bon builder generator 2.0 release(elastio.github.io)
elastio.github.io
Bon builder generator 2.0 release
https://elastio.github.io/bon/blog/bon-builder-generator-v2-release
2 comments
It's great to see the rapid iteration on this. Congratulations on the adoption so far!
It must be so cool to work at a company that is cool with open-sourcing projects like this ;)
It must be so cool to work at a company that is cool with open-sourcing projects like this ;)
GitHub repo of the crate: https://github.com/elastio/bon
---
If you are new to `bon`, here is a quick example of it's API. `bon` can generate a builder from a function, effectively solving the problem of named function arguments in Rust described in [the introduction blog post](https://elastio.github.io/bon/blog/how-to-do-named-function-...).
```rust
use bon::builder;
#[builder]
fn greet(name: &str, age: u32) -> String {
}
let greeting = greet()
assert_eq!(greeting, "Hello Bon with age 24!");
```
It also supports generating builders from structs and associated methods. See the [Github repo](https://github.com/elastio/bon) and the [crate overview guide](https://elastio.github.io/bon/guide/overview) for details.
If you like the idea of this crate and want to say "thank you" or "keep doing this" consider giving us a [star on Github](https://github.com/elastio/bon). Any support and contribution are appreciated !
---
From now on I will also be posting updates about `bon` on X (Twitter): https://x.com/veetaha
This post is also available on Reddit: https://www.reddit.com/r/rust/comments/1f1uzkw/bon_builder_g...