# CHANGELOG
## Notable changes since v0.4.0
- The generated method `const_from` is now `from_inner` for better readability.
- Fix HRTB and default generic type handling, see the docs for details.
- No longer add `#[repr(transparent)]` attribute by default.
## Notable changes since v0.3.0
- Starting from v0.3.1, the complex usage now accept any inner field name (but must be the first one).
```rust
wrapper_lite::wrapper!(
#[wrapper_impl(AsRef<str>)]
pub struct TestWrapperComplex {
value: String, _marker: ::core::marker::PhantomData<()>,
}
);
```
- In v0.3.1, we introduce `#[repr(align(cache))]` attribute for the wrapper struct.
```rust
wrapper_lite::wrapper!(
#[repr(align(cache))]
pub struct AlignedWrapper(u8);
);
```
See the docs for usage details.
## Migrate from v0.2.X
1. The macro now only accepts valid Rust struct syntax.
```rust
wrapper_lite::wrapper!(
pub struct TestWrapper1(u8); );
```
```rust
wrapper_lite::wrapper!(
pub struct TestWrapper2 {
inner: u8,
}
);
```
1. When there's no default value specified, we cannot implement the `From` trait for the wrapper type, and now it's a hard error.
```rust,compile_fail
wrapper_lite::wrapper!(
#[wrapper_impl(From)]
pub struct TestWrapperComplex<'a, 'b> {
inner: String,
_a: ::core::marker::PhantomData<&'a ()>,
_b: ::core::marker::PhantomData<&'b ()>,
}
);
```
## Migrate from v0.1.X
To make `cargo-fmt` happy, starting from v0.2.0, the following usage which is not a valid Rust struct syntax is no longer accepted.
```rust,compile_fail
wrapper_lite::wrapper!(
pub ExampleWrapper(u8)
);
```
Instead:
```rust
wrapper_lite::wrapper!(
pub struct ExampleWrapper(u8);
);
```
Now we can format the macro content with `cargo fmt`!