smart-default
Rust custom-derive macro for Default with more control on the fields
0.7.1
43M downloads/mo
#1354 most downloaded on crates.io
idanarye/rust-smart-default
What this package is like to depend on
Last release 3 years ago
no release in 18 months
Ships unpredictably
gaps range from 1 weeks to 3.4 years
Nearly every release is documented
notes for 10 of 10 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
10 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
10 releases · Aug 2017 to Apr 2023
2018
2019
2020
2021
2022
2023
2024
2025
2026
Releases
latest 10-
0.7.124 Apr 2023Release notes
Open source →Fixed
- Fixed bug where the macro fails on valid default expression that is also a
valid attribute meta because it was expecting the
_codehack.
- Fixed bug where the macro fails on valid default expression that is also a
valid attribute meta because it was expecting the
-
0.7.023 Apr 2023 -
0.6.013 Dec 2019 -
0.5.213 Apr 2019Release notes
Open source →Fixed
- Omit linting of generated code by adding
#[automatically_derived]attribute.
- Omit linting of generated code by adding
-
0.5.101 Mar 2019Release notes
Open source →Fixed
- Don't use a multi-pattern
if let, as this unnecessarily requires version 1.33.0 of Rust.
- Don't use a multi-pattern
-
0.5.028 Feb 2019Release notes
Open source →Changed
- When the default is a string literal, strap an
.into()after it to automatically convert it toStringwhen needed.
- When the default is a string literal, strap an
-
0.4.018 Feb 2019Release notes
Open source →Added
#[default(_code = "...")]syntax for defaults that cannot be parsed as attributes no matter what.
-
0.3.002 Nov 2018Release notes
Open source →Changed
- Require Rust 1.30+.
- Use direct attribute value instead of having to wrap them in strings.
- Moved the docs from the module level to the custom derive.
Added
#[default(...)]syntax in addition to#[default = ...]. This is required to deal with some parsing limitations.
-
0.2.021 Aug 2017Release notes
Open source →Added
- Support generic types.
- Generate doc for the trait impl that describes the default values.
-
0.1.018 Aug 2017Release notes
Open source →Added
- Custom derive
SmartDefaultfor implementing theDefaulttrait. #[default = ...]attribute on fields for smart-default.
- Custom derive