All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Fixed bug where the macro fails on valid default expression that is also a
valid attribute meta because it was expecting the
_code
hack.
- Update
syn
to version 2
- Update
syn
,quote
andproc-macro2
versions to1.*.*
.
- Omit linting of generated code by adding
#[automatically_derived]
attribute.
- Don't use a multi-pattern
if let
, as this unnecessarily requires version 1.33.0 of Rust.
- When the default is a string literal, strap an
.into()
after it to automatically convert it toString
when needed.
#[default(_code = "...")]
syntax for defaults that cannot be parsed as attributes no matter what.
- 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.
#[default(...)]
syntax in addition to#[default = ...]
. This is required to deal with some parsing limitations.
- Support generic types.
- Generate doc for the trait impl that describes the default values.
- Custom derive
SmartDefault
for implementing theDefault
trait. #[default = ...]
attribute on fields for smart-default.