Skip to content

Commit 88a33a7

Browse files
committed
Apply prettier
1 parent b98b401 commit 88a33a7

32 files changed

+286
-286
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ See [alternatives](https://bon-rs.com/guide/alternatives) for comparison.
214214

215215
Some notable users:
216216

217-
- [`crates.io` backend](https://github.com/rust-lang/crates.io)
218-
- [`ractor`](https://github.com/slawlor/ractor)
219-
- [`comrak`](https://github.com/kivikakk/comrak)
220-
- [`soldeer`](https://github.com/mario-eth/soldeer) (package manager endorsed by [`foundry`](https://github.com/foundry-rs/foundry))
221-
- [`tachyonfx`](https://github.com/junkdog/tachyonfx)
217+
- [`crates.io` backend](https://github.com/rust-lang/crates.io)
218+
- [`ractor`](https://github.com/slawlor/ractor)
219+
- [`comrak`](https://github.com/kivikakk/comrak)
220+
- [`soldeer`](https://github.com/mario-eth/soldeer) (package manager endorsed by [`foundry`](https://github.com/foundry-rs/foundry))
221+
- [`tachyonfx`](https://github.com/junkdog/tachyonfx)
222222

223223
## Getting Help
224224

benchmarks/compilation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is a collection of compilation time benchmarks for the code generated by `b
66

77
If you'd like to run the benchmarks yourself, first you need to install the following:
88

9-
- [`hyperfine`](https://github.com/sharkdp/hyperfine) CLI
9+
- [`hyperfine`](https://github.com/sharkdp/hyperfine) CLI
1010

1111
If you are on Linux, just run the following commands to install the dependencies:
1212

benchmarks/runtime/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This is a collection of runtime benchmarks for the code generated by `bon` crate
66

77
If you'd like to run the benchmarks yourself, first you need to install the following:
88

9-
- `Valgrind`. Its `cachegrind` component is used by [`iai`](https://github.com/bheisler/iai) benchmark to display the instruction counts and cache/RAM hits.
10-
- `cargo-asm`. It's used to get the resulting assembly code for the benchmarked functions.
9+
- `Valgrind`. Its `cachegrind` component is used by [`iai`](https://github.com/bheisler/iai) benchmark to display the instruction counts and cache/RAM hits.
10+
- `cargo-asm`. It's used to get the resulting assembly code for the benchmarked functions.
1111

1212
If you are on Ubuntu or Debian, just run the following commands to install the dependencies:
1313

website/infra/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ It is a simple Hetzner VPS that runs a docker-compose cluster with the umami ser
88

99
Prerequisites:
1010

11-
- [Terraform CLI](https://developer.hashicorp.com/terraform/install)
12-
- [Account at hetzner.com/cloud](https://hetzner.com/cloud)
11+
- [Terraform CLI](https://developer.hashicorp.com/terraform/install)
12+
- [Account at hetzner.com/cloud](https://hetzner.com/cloud)
1313

1414
Create a `terraform.tfvars` file in this directory. Here is an example below, make sure to replace all `{...}` placeholders with your values.
1515

website/src/blog/bon-builder-generator-v2-release.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ Now the documentation was split into the ["Guide"](../guide/overview) and ["Refe
6060

6161
We added 3 new pages with guides on how to use builders idiomatically or solve some common problems (e.g. validating inputs):
6262

63-
- [Conditional Building](../guide/patterns/conditional-building)
64-
- [Fallible Builders](../guide/patterns/fallible-builders)
65-
- [Into Conversions In-Depth](../guide/patterns/into-conversions-in-depth)
63+
- [Conditional Building](../guide/patterns/conditional-building)
64+
- [Fallible Builders](../guide/patterns/fallible-builders)
65+
- [Into Conversions In-Depth](../guide/patterns/into-conversions-in-depth)
6666

6767
I recommend you to check out the ["Into Conversions In-Depth"](../guide/patterns/into-conversions-in-depth) especially because it's highly related to one of the breaking changes that we'll review below.
6868

@@ -222,8 +222,8 @@ Also, huge thank you for 500 stars ⭐ [on Github](https://github.com/elastio/bo
222222

223223
You can leave comments for this post on the platform of your choice:
224224

225-
- [Reddit](https://www.reddit.com/r/rust/comments/1f1uzkw/bon_builder_generator_20_release/)
226-
- [X (Twitter)](https://x.com/veetaha/status/1828210142514491658)
227-
- [Hacker News](https://news.ycombinator.com/item?id=41359892)
225+
- [Reddit](https://www.reddit.com/r/rust/comments/1f1uzkw/bon_builder_generator_20_release/)
226+
- [X (Twitter)](https://x.com/veetaha/status/1828210142514491658)
227+
- [Hacker News](https://news.ycombinator.com/item?id=41359892)
228228

229229
:::

website/src/blog/bon-builder-v2-1-release.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ This optimization covers only the code produced by expanding the [`#[bon::builde
2929

3030
The `#[builder]` macro now [benefits](https://github.com/elastio/bon/blob/88529337e261e8ca11268b2d4759f9372d802e45/bon/src/private/mod.rs#L8-L32) from the [`#[diagnostic::on_unimplemented]`](https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-diagnosticon_unimplemented-attribute) attribute. It now generates a readable compile error with additional context for debugging in the following cases:
3131

32-
- Forgetting to set a required member.
33-
- Setting the same member twice (unintentional overwrite).
32+
- Forgetting to set a required member.
33+
- Setting the same member twice (unintentional overwrite).
3434

3535
Let's see this in action in the following example of code:
3636

@@ -249,8 +249,8 @@ Also, a huge thank you for 600 stars ⭐ [on Github](https://github.com/elastio/
249249

250250
You can leave comments for this post on the platform of your choice:
251251

252-
- [Reddit](https://www.reddit.com/r/rust/comments/1f6d7vr/media_nextgen_builder_macro_bon_21_release/)
253-
- [X (Twitter)](https://x.com/veetaha/status/1830221731677839637)
252+
- [Reddit](https://www.reddit.com/r/rust/comments/1f6d7vr/media_nextgen_builder_macro_bon_21_release/)
253+
- [X (Twitter)](https://x.com/veetaha/status/1830221731677839637)
254254

255255
:::
256256

website/src/blog/bon-builder-v2-2-release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ Also, a huge thank you for 750 stars ⭐ [on Github](https://github.com/elastio/
228228

229229
You can leave comments for this post on the platform of your choice:
230230

231-
- [Reddit](https://www.reddit.com/r/rust/comments/1fc0ai7/media_nextgen_builder_macro_bon_22_release_derive/)
232-
- [X (Twitter)](https://x.com/veetaha/status/1832804375154065432)
231+
- [Reddit](https://www.reddit.com/r/rust/comments/1fc0ai7/media_nextgen_builder_macro_bon_22_release_derive/)
232+
- [X (Twitter)](https://x.com/veetaha/status/1832804375154065432)
233233

234234
:::
235235

website/src/blog/bon-builder-v2-3-release.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ As an example, suppose we have a `Treasure` struct with `x` and `y` coordinates
3131

3232
To do that we can use the `#[builder(start_fn)]` attribute. There are two contexts where we can place it, and they both have a different meaning:
3333

34-
- [Top-level `#[builder(start_fn = ...)]`](../reference/builder/top-level/start_fn) - configures the name of the starting function and optionally its visibility
35-
- [Member-level `#[builder(start_fn)]`](../reference/builder/member/start_fn) - configures the member to be a positional parameter on the starting function
34+
- [Top-level `#[builder(start_fn = ...)]`](../reference/builder/top-level/start_fn) - configures the name of the starting function and optionally its visibility
35+
- [Member-level `#[builder(start_fn)]`](../reference/builder/member/start_fn) - configures the member to be a positional parameter on the starting function
3636

3737
We'll want to use both of these attributes in our example to give a better name for the starting function that describes its inputs and configure `x` and `y` as positional parameters on the starting function as well.
3838

@@ -146,8 +146,8 @@ Bon's goal is to empower everyone to build beautiful APIs with great flexibility
146146

147147
You can leave comments for this post on the platform of your choice:
148148

149-
- [Reddit](https://www.reddit.com/r/rust/comments/1fgmbo7/media_nextgen_builder_macro_bon_23_release/)
150-
- [X (Twitter)](https://x.com/veetaha/status/1834951093559648544)
149+
- [Reddit](https://www.reddit.com/r/rust/comments/1fgmbo7/media_nextgen_builder_macro_bon_23_release/)
150+
- [X (Twitter)](https://x.com/veetaha/status/1834951093559648544)
151151

152152
:::
153153

website/src/blog/bon-v3-release.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ let b: TbExampleBuilder<((Private,), (i32,), ())> = TbExample::builder().x1(1).x
9292

9393
`typed-builder` uses a tuple to represent the typestate with the following rules:
9494

95-
- The number of items in the tuple corresponds to the number of fields in the struct.
96-
- `()` item in the tuple represents a field that was not set yet.
97-
- `(T,)` item in the tuple represents a field that was already set; `T` is the type of that field.
95+
- The number of items in the tuple corresponds to the number of fields in the struct.
96+
- `()` item in the tuple represents a field that was not set yet.
97+
- `(T,)` item in the tuple represents a field that was already set; `T` is the type of that field.
9898

9999
`typed-builder`'s approach violates privacy by exposing the internals of the struct:
100100

101-
- 🚨 Types of the struct's fields
102-
- 🚨 Order of struct's fields' declaration
103-
- 🚨 Number of struct's fields
101+
- 🚨 Types of the struct's fields
102+
- 🚨 Order of struct's fields' declaration
103+
- 🚨 Number of struct's fields
104104

105105
If the users of `typed-builder` ever write a type annotation for the builder, then their code becomes fragile to any changes in the struct's private fields.
106106

@@ -110,8 +110,8 @@ Starting with this release, `bon` uses a layered typestate that doesn't mention
110110

111111
However, `bon`'s signature depends on the order of setter calls. For example:
112112

113-
- if you call `x1(1).x2(2)`, the type state is `SetX2<SetX1>`
114-
- if you call `x2(2).x1(1)`, the type state is `SetX1<SetX2>`
113+
- if you call `x1(1).x2(2)`, the type state is `SetX2<SetX1>`
114+
- if you call `x2(2).x1(1)`, the type state is `SetX1<SetX2>`
115115

116116
This is still better than the tuple approach. The setter calls order is controlled by the caller, so this isn't private to them anyway.
117117

@@ -292,11 +292,11 @@ struct Example {}
292292

293293
There were many new attributes added to override the visibility and the documentation of various items generated by the builder macros:
294294

295-
- [`builder_type(vis = "...", doc { ... })`](../reference/builder/top-level/builder_type)
296-
- [`start_fn(vis = "...", doc { ... })`](../reference/builder/top-level/start_fn)
297-
- [`finish_fn(vis = "...", doc { ... })`](../reference/builder/top-level/finish_fn)
298-
- [`state_mod(vis = "...", doc { ... })`](../reference/builder/top-level/state_mod)
299-
- [`setters(vis = "...", doc { ... })`](../reference/builder/member/setters)
295+
- [`builder_type(vis = "...", doc { ... })`](../reference/builder/top-level/builder_type)
296+
- [`start_fn(vis = "...", doc { ... })`](../reference/builder/top-level/start_fn)
297+
- [`finish_fn(vis = "...", doc { ... })`](../reference/builder/top-level/finish_fn)
298+
- [`state_mod(vis = "...", doc { ... })`](../reference/builder/top-level/state_mod)
299+
- [`setters(vis = "...", doc { ... })`](../reference/builder/member/setters)
300300

301301
The `doc` block accepts actual doc comments (not strings), for example:
302302

@@ -318,8 +318,8 @@ Now, that the [Typestate API](../guide/typestate-api) is in place, and you can a
318318

319319
There are ideas for a new `#[builder(flag)]` attribute ([#142](https://github.com/elastio/bon/issues/142)) that would generate a pair of setters:
320320

321-
- `member()` - doesn't accept any arguments, sets the member to `true`
322-
- `with_member(bool)` - accepts a boolean value like a usual setter
321+
- `member()` - doesn't accept any arguments, sets the member to `true`
322+
- `with_member(bool)` - accepts a boolean value like a usual setter
323323

324324
These features are on the next priority list for `bon`, so stay tuned for more updates!
325325

@@ -333,9 +333,9 @@ Bon's goal is to empower everyone to build beautiful APIs with great flexibility
333333

334334
See what people are saying about this on:
335335

336-
- [Reddit](https://www.reddit.com/r/rust/comments/1gqbgbb/media_nextgen_builder_macro_bon_30_release/)
337-
- [Hackernews](https://news.ycombinator.com/item?id=42125379)
338-
- [X (Twitter)](https://x.com/veetaha/status/1856675619276235242)
336+
- [Reddit](https://www.reddit.com/r/rust/comments/1gqbgbb/media_nextgen_builder_macro_bon_30_release/)
337+
- [Hackernews](https://news.ycombinator.com/item?id=42125379)
338+
- [X (Twitter)](https://x.com/veetaha/status/1856675619276235242)
339339

340340
:::
341341

website/src/blog/the-weird-of-function-local-types-in-rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ It means, that if we want to support local items in our macro we just can't use
320320

321321
The core problem is the conflict:
322322

323-
- We want to make the builder's fields private, so we need to define the builder struct inside of a child module.
324-
- We want to reference types from the surrounding scope in the builder's fields, including local items, so we can't define the builder struct inside the child module.
323+
- We want to make the builder's fields private, so we need to define the builder struct inside of a child module.
324+
- We want to reference types from the surrounding scope in the builder's fields, including local items, so we can't define the builder struct inside the child module.
325325

326326
This is the problem that I found in `buildstructor`. The only way to solve this is to make a compromise, which I did when implementing [`#[derive(bon::Builder)]`](../guide/overview). The compromise is not to use a child module, and obfuscate the private fields of the builder struct with leading `__` and `#[doc(hidden)]` attributes to make it hard for the user to access them (even though not physically impossible).
327327

0 commit comments

Comments
 (0)