fix(deps): update rust crate bon to v3 #51
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: kernald/immich-tools#51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/bon-3.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
2.3.0->3.0.0Release Notes
elastio/bon (bon)
v3.8.1Compare Source
Fixed
clippy::wrong_self_conventionwarning for fields withis_prefix etc. (#349). Thanks @nicmue for the contribution!Internal
clippy::wrong_self_convention(#350)v3.8.0Compare Source
Lint Update Notice
This release brings some rustdoc improvements and no other visible API changes except that
rustcandclippywill start reporting some more true-positive lints. For example builder methods defined via an impl block annotated with#[bon]will now be correctly reported as unused if they are not used. Also, using a private type in a public builder method will trigger aprivate_interfaceslint now.This is all thanks to the updated span handling design researched and implemented by @Eisverygoodletter. It's not clear what other new lints the new span handling may trigger in other realworld codebases. If you see a lint from the code generated by
bonthat you think shouldn't be there, please, open an issue, and it'll be fixed as soon as possible!Changed
Internal
v3.7.2Compare Source
Fixed
derive(IntoFuture)impl block (#337)rustversionto v1.0.19 (#336). Thanks @Fokko for the contribution!v3.7.1Compare Source
This is a small patch release to make
boneasier to package for Debian.Other
Internal
v3.7.0Compare Source
Added
#[builder(derive(IntoFuture(Box)))](#322).This allows calling
builder.awaitinstead ofbuilder.call().await. Thanks @jakubadamw for the contribution!Fixed
whereclause forwarding to#[builder(derive(Into))](#325)Internal
experimental-overwritablefeature (#326)v3.6.5Compare Source
This is a regular maintenance release with no essential API/behavior changes. Enjoy the stability 😄.
Docs
Internal
darling(crate for parsing the attributes) from0.20to0.21and other internal dependencies (#317, #320, #304)iaitoiai-callgrindfor high-precision benchmarking ofbon(#311).iai-callgrindis a better maintained alternative toiai, but in any case, both deserve a huge thanks for providing the benchmarking capabilities forbon!clippy::or_fun_calllint from the nightly toolchain (#316)v3.6.4Compare Source
Added
#[bon::builder]fully qualified attribute inside of impl blocks (#297)v3.6.3Compare Source
Fixed
#[builder(field)]with#[builder(const)](#291)v3.6.2Compare Source
Added
#[target_feature]attributes on#[builder]-generated finishing functions (#284). Thanks @Lilyyy411 for the contribution!Fixed
consttoken order in code generated by#[builder(const)](#288)v3.6.1Compare Source
Fixed
#[track_caller]to the generated finishing function from the underlying function/method (#282). Thanks @Lilyyy411 for the contribution!v3.6.0Compare Source
Added
#[builder(const)](#279).See the updated docs here
v3.5.2Compare Source
Fixed
#[builder](#275).This doesn't fix the problem fully since function parameters are now assigned "variable" semantic token type instead of "parameter". However, it's already better than "struct" that they were assigned before this fix. Created an issue in rust-analyzer with more details and to get the full fix of this problem: rust-lang/rust-analyzer#19556.
v3.5.1Compare Source
Fixed
__orig_{fn_name}) until after all other macros are expanded (#269). Also removed the warnings for#[tracing::instrument]users introduced in #264. This is because with this patch there will be no difference whether you place#[tracing::instrument]after or before the#[builder]attribute - all other proc macros on the function will see the original function name.v3.5.0Compare Source
Added
setters(doc(default(skip)))attribute to skip the inclusion of the default value in the generated docs for setters (#265). See the updated docs here.Fixed
#[tracing::instrument]is placed after the#[builder]instead of before (#264). This should prevent the papercut wheretracing::instrumentassigns the span name with the ugly__orig_prefix in the name.#[builder]attributes getting ignored on free functions (#263)v3.4.0Compare Source
Added
#[builder(getter)]attribute MVP (#251).The cargo feature
experimental-gettersis no longer needed and is now no-op.selfreceiver andstart_fnmembers available as official fields on the builder (#250).Check the new documentation page about native fields.
#[builder(derive(Into))]attribute to generate animpl From<Builder> for T(#248).See the updated "Inspecting" guide page now known as Derives for Builders and the updated
#[builder(derive)]reference.Other
Acknowledgements
100$a month!1$a month!v3.3.2Compare Source
Fixed
self_(#238)v3.3.1Compare Source
Fixed
clippy::empty_enumtriggering on nightly withfeature(never_type)enabled (#234)v3.3.0Compare Source
Added
clone,copy,derefconfigs support in#[builder(getter)](see new docs) (#229)v3.2.0Compare Source
Added
#[builder(getter(...))]attribute to define getters for already set members. See Getters guide for details (#222) (#226). Thanks @lazkindness for the contribution!v3.1.1Compare Source
Fixed
v3.1.0Compare Source
Added
#[builder(field)]to define custom private fields on the builder type. See Custom Fields guide for details (#207)Other
bons test suite (#215)v3.0.2Compare Source
Fixed
unexpected_cfgslint coming from#[cfg(rust_analyzer)]on the latest nightly (#212)v3.0.1Compare Source
Fixed
v3.0.0Compare Source
See the most interesting changes described in Bon 3.0 Release blog post.
All the breaking changes are very unlikely to actually break your code that was written against the
v2version ofbon. 99% of users should be able to update without any migration.Changed
🎉🎉 Stabilize the builder's typestate API allowing for custom builder extensions. This is the main theme of this release. This new API brings the flexibility to a whole new level 🚀 🚀 (#145)
Improve rustdoc output. See the rustoc examples and comparison in the Alternatives section (#145)
Add info that the member is required or optional.
For members with default values show the default value in the docs.
For optional members provide links to
{member}(T)andmaybe_{member}(Option<T>)setters.Remove
__prefixes for generic types and lifetimes from internal symbols. Instead, the prefixes added only if the macro detects a name collision.⚠️ Breaking. Reject unnecessary empty attributes e.g.
#[builder()]or#[builder]with no parameters on a member (#145)⚠️ Breaking. Reject square brackets and curly braces delimiters for
builder_type,finish_fn,start_fnandonattributes syntax. Only parentheses are accepted e.g.#[builder(finish_fn(...))]or#[builder(on(...))]. This no longer works:#[builder(finish_fn[...])]or#[builder(on{...})](#145)⚠️ Breaking. Reject non-consecutive
on(...)clauses. For example, the following now generates a compile error:#[builder(on(String, into), finish_fn = build, on(Vec<_>, into))], because there is afinish_fn = ...betweenon(...)clauses. (#155)⚠️ Breaking.
#[builder(derive(Clone, Debug))]now generates impl blocks that follow the behaviour of standardCloneandDebugderives in that it conservatively addsClone/Debugtrait bounds for all the generic types declared on the original item (struct or function). Previously no additional bounds were required onCloneandDebugimpls. See the Added section for details on the way to override these bounds with#[builder(derive(Clone/Debug(bounds(...))))](#145)⚠️ Breaking. The name of the builder struct generated for methods named
builderchanged fromTBuilderBuilderto justTBuildermaking methods namedbuilderwork the same as methods namednew. (#145)⚠️ Breaking. The type of the builder is now dependent on the order of the setters' invocation. This may only break code like the following:
This is because the types of the builders returned from the branches are the following:
FooBuilder<SetB<SetA>>(ifbranch)FooBuilder<SetA<SetB>>(elsebranch)We believe such code should generally be very rare and even if it breaks, it's easy to fix it by reordering the setter method calls. This compromise was accepted as a design tradeoff such that the builder's type signature becomes simpler, the generated documentation becomes much less noisy, it removes an annoying special case for the builder of just one member, and it improves the type-checking performance considerably compared to the previous approach that used tuples to represent the type state. (#145)
Removed
⚠️ Breaking. Remove support for
#[bon::builder]proc-macro attribute on top of astruct. Use#[derive(bon::Builder)]for that instead. This syntax has been deprecated since2.1and it is now removed as part of a major version cleanup (#145)⚠️ Breaking. Remove
#[builder(expose_positional_fn = positional_fn_name)]attribute. Use#[builder(start_fn = builder_fn_name)]instead, since this attribute works additively keeping the function with positional arguments under the attribute unchanged. (#153)Added
⚠️ Breaking. Builder macros now generate additional
mod builder_name {}wherebuilder_nameis the snake_case version of the name of the builder struct. This new module contains the type state API of the builder. There is a low probability that this new module name may conflict with existing symbols in your scope, so this change is marked as breaking (#145)Add
#[builder(builder_type(vis = "...", doc { ... }))]that allows overriding the visibility and docs of the builder struct (#145)Add
#[builder(finish_fn(vis = "...", doc { ... } ))]that allows overriding the visibility and docs of the finishing function (#145)Add
#[builder(start_fn(doc { ... }))]that allows overriding the docs of the starting function (#145)Add
#[builder(with = closure)]syntax to customize setters with a closure. If the closure returns aResult<_, E>the setters become fallible (#145)Add
#[builder(with = Some)],#[builder(with = FromIterator::from_iter)],#[builder(with = <_>::from_iter)]syntax support for two well-known functions that will probably be used frequently (#157)Add
#[builder(required)]forOptionfields to opt out from their special handling which makesbontreat them as regular required fields. It's also available at the top-level via#[builder(on(_, required))](#145, #155)Add
#[builder(crate = path::to::bon)]and#[bon(crate = path::to::bon)]to allow overriding the path toboncrate used in the generated code, which is useful for the cases whenbonmacros are wrapped by other macros (#153)Add
#[builder(state_mod)]to configure the builder's type state API module name, visibility and docs (#145)🔬 Experimental. Add
#[builder(overwritable)]and#[builder(on(..., overwritable)]to make it possible to call setters multiple times for the same member. This attribute is available under the cargo feature"experimental-overwritable". The fate of this feature depends on your feedback in the tracking issue #149. Please, let us know if you have a use case for this attribute! (#145)Add
#[builder(setters)]to fine-tune the setters names, visibility and docs (#145)Add
#[builder(derive(Clone/Debug(bounds(...))]to allow overriding trait bounds on theClone/Debugimpl block of the builder (#145)Add inheritance of
#[allow()]and#[expect()]lint attributes to all generated items. This is useful to suppress any lints coming from the generated code. Although, lints coming from the generated code are generally considered defects inbonand should be reported via a Github issue, but this provides an easy temporary workaround for the problem (#145)Fixed
unused_mutlints coming from#[builder]on a method that takesmut self(#197)#[cfg/cfg_attr()]not being expanded when used on function arguments with doc comments or other attributes (#145)Other
bonmacro panics due to an internal bug, the macro will try to generate a fallback for IDEs to still provide intellisense (#145)elastio.github.io/bonto a custom domainbon-rs.com(#158)umamifor the docs website (#158)Docs
Refactor the README.md and all pages in the Guide Book by simplifying them and removing redundancies (#170)
Add new pages to the Guide Book:
Custom Conversions (#170)
Typestate API (#170)
Builder's Type Signature (#170)
Custom Methods (#171)
Optional Generic Members (#173)
Compilation Benchmarks (#177)
Split API reference into multiple pages. The root page now contains a convenient table with short descriptions of all available configuration attributes (#164)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
4b1ca3296bto8938feaefa8938feaefato37b93750bd37b93750bdto336d7e51b7336d7e51b7toa936d5814ca936d5814ctoa36e96f848a36e96f848toaad620701aaad620701ato39025d369c