Skip to content

Commit 4aa3079

Browse files
daxpeddaModProg
authored andcommitted
Adjust language about Default on enums
1 parent feffea0 commit 4aa3079

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ struct Example<T, U>(PhantomData<T>, PhantomData<U>);
9494

9595
### Enum default
9696

97-
Deriving [`Default`] on an enum is not possible in Rust at the moment.
98-
Derive-where allows this with a `default` attribute:
97+
Since Rust 1.62 deriving [`Default`] on an enum is possible with the
98+
`#[default]` attribute. Derive-where allows this with a
99+
`#[derive_where(default)]` attribute:
99100

100101
```rust
101102
#[derive_where(Default)]

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@
108108
//!
109109
//! ## Enum default
110110
//!
111-
//! Deriving [`Default`] on an enum is not possible in Rust at the moment.
112-
//! Derive-where allows this with a `default` attribute:
111+
//! Since Rust 1.62 deriving [`Default`] on an enum is possible with the
112+
//! `#[default]` attribute. Derive-where allows this with a
113+
//! `#[derive_where(default)]` attribute:
113114
//!
114115
//! ```
115116
//! # use std::marker::PhantomData;

0 commit comments

Comments
 (0)