Skip to content

Commit 01704af

Browse files
committed
Stabilize the current #[builder(getter)] feature MVP
1 parent 72b058d commit 01704af

File tree

7 files changed

+15
-40
lines changed

7 files changed

+15
-40
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ jobs:
112112
- run: cargo test --locked --all-features --doc
113113
- run: |
114114
cd bon && cargo test --locked --no-default-features \
115-
--features=experimental-overwritable,experimental-getter
115+
--features=experimental-overwritable
116116
117117
- run: |
118118
cd bon && cargo test --locked --no-default-features \
119-
--features=experimental-overwritable,experimental-getter,alloc
119+
--features=experimental-overwritable,alloc
120120
121121
- run: |
122122
cd bon && cargo test --locked --no-default-features \
123-
--features=experimental-overwritable,experimental-getter,implied-bounds
123+
--features=experimental-overwritable,implied-bounds
124124
125125
- run: |
126126
cd bon && cargo test --locked --no-default-features \
127-
--features=experimental-overwritable,experimental-getter,alloc,implied-bounds
127+
--features=experimental-overwritable,alloc,implied-bounds
128128
129129
test-msrv:
130130
runs-on: ${{ matrix.os }}-latest

bon-macros/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ rustversion = "1.0"
6363
[features]
6464
default = []
6565

66-
# See the docs on this feature in the `bon`'s crate `Cargo.toml`.
67-
experimental-getter = []
68-
6966
# See the docs on this feature in the `bon`'s crate `Cargo.toml`
7067
experimental-overwritable = []
7168

bon-macros/src/builder/builder_gen/member/config/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,18 +223,6 @@ impl MemberConfig {
223223
}
224224

225225
if let Some(getter) = &self.getter {
226-
if !cfg!(feature = "experimental-getter") {
227-
bail!(
228-
&getter.key,
229-
"🔬 `getter` attribute is experimental and requires \
230-
\"experimental-getter\" cargo feature to be enabled; \
231-
if you find the current design of this attribute already \
232-
solid please leave a 👍 reaction under the issue \
233-
https://github.com/elastio/bon/issues/225; if you have \
234-
any feedback, then feel free to leave a comment under that issue",
235-
);
236-
}
237-
238226
self.validate_mutually_exclusive(
239227
ParamName::Getter,
240228
getter.key.span(),

bon-sandbox/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ derive_builder = "0.20"
3434
typed-builder = "0.20"
3535

3636
[dependencies.bon]
37-
features = ["experimental-overwritable", "experimental-getter"]
37+
features = ["experimental-overwritable"]
3838
path = "../bon"
3939
version = "=3.3.2"

bon/Cargo.toml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,9 @@ implied-bounds = ["bon-macros/implied-bounds"]
8383
# describing your use case for it.
8484
experimental-overwritable = ["bon-macros/experimental-overwritable"]
8585

86-
# 🔬 Experimental! There may be breaking changes to this feature between *minor* releases,
87-
# however, compatibility within patch releases is guaranteed though.
88-
#
89-
# This feature enables the #[builder(getter)] attribute that can be used to
90-
# allow getting references to already set fields in the builder.
91-
#
92-
# See more info at https://bon-rs.com/reference/builder/member/getter.
86+
# Legacy experimental attribute. It's left here for backwards compatibility,
87+
# and it will be removed in the next major release.
9388
#
94-
# The fate of this feature depends on your feedback in the tracking issue
95-
# https://github.com/elastio/bon/issues/225. Please, let us know if you
96-
# have any ideas how to make this attribute better, or if it's already good enough!
97-
experimental-getter = ["bon-macros/experimental-getter"]
89+
# We've stabilized the MVP of this feature, so it's no longer experimental.
90+
# The tracking issue for this feature: https://github.com/elastio/bon/issues/225.
91+
experimental-getter = []

scripts/test-msrv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ step cargo update -p libc --precise 0.2.163
4040

4141
export RUSTFLAGS="${RUSTFLAGS:-} --allow unknown-lints"
4242

43-
features=experimental-overwritable,experimental-getter
43+
features=experimental-overwritable
4444

4545
step cargo clippy --all-targets --locked --features "$features"
4646

website/src/reference/builder/member/getter.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
# `getter` :microscope:
1+
# `getter`
22

33
**Applies to:** <Badge type="warning" text="struct fields"/> <Badge type="warning" text="function arguments"/> <Badge type="warning" text="method arguments"/>
44

55
Generates a getter method for a member. The method is callable only after the value for the member is set using any of its setters.
66

7-
::: danger 🔬 **Experimental**
7+
> This attribute has some planned future extensions described in the tracking issue [#225](https://github.com/elastio/bon/issues/225). Any feedback is appreciated!
88
9-
This attribute is available under the cargo feature `experimental-getter`. Breaking changes may occur between **minor** releases but not between patch releases.
10-
11-
The fate of this feature depends on your feedback in the tracking issue [#225](https://github.com/elastio/bon/issues/225). Please, let us know if you have any ideas on improving this attribute, or if it's already good enough!
12-
13-
:::
9+
---
1410

1511
The getter for a required member returns `&T` by default (can be [overridden](#overriding-the-return-type)).
1612

@@ -119,7 +115,7 @@ You can override the return type of the getter, its name, visibility, and docs.
119115
deref,
120116
121117
// Return the type specified in parens.
122-
// A deref coercion is expected to be valid to the specified type.
118+
// There must exist a deref coercion is to the specified type.
123119
// Don't specify the leading `&` here.
124120
deref(T),
125121

0 commit comments

Comments
 (0)