PackageTrack
Sign in Get early access

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
Release Pre-release

Releases

latest 10
  1. 0.7.1 24 Apr 2023
    Release notes

    Fixed

    • Fixed bug where the macro fails on valid default expression that is also a valid attribute meta because it was expecting the _code hack.
    Open source →
  2. 0.7.0 23 Apr 2023
    Release notes

    Changed

    • Update syn to version 2
    Open source →
  3. 0.6.0 13 Dec 2019
    Release notes

    Changed

    • Update syn, quote and proc-macro2 versions to 1.*.*.
    Open source →
  4. 0.5.2 13 Apr 2019
    Release notes

    Fixed

    • Omit linting of generated code by adding #[automatically_derived] attribute.
    Open source →
  5. 0.5.1 01 Mar 2019
    Release notes

    Fixed

    • Don't use a multi-pattern if let, as this unnecessarily requires version 1.33.0 of Rust.
    Open source →
  6. 0.5.0 28 Feb 2019
    Release notes

    Changed

    • When the default is a string literal, strap an .into() after it to automatically convert it to String when needed.
    Open source →
  7. 0.4.0 18 Feb 2019
    Release notes

    Added

    • #[default(_code = "...")] syntax for defaults that cannot be parsed as attributes no matter what.
    Open source →
  8. 0.3.0 02 Nov 2018
    Release notes

    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.
    Open source →
  9. 0.2.0 21 Aug 2017
    Release notes

    Added

    • Support generic types.
    • Generate doc for the trait impl that describes the default values.
    Open source →
  10. 0.1.0 18 Aug 2017
    Release notes

    Added

    • Custom derive SmartDefault for implementing the Default trait.
    • #[default = ...] attribute on fields for smart-default.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive