We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since Rust has introduced #[default], can we hightlight it in the doc? Like this one:
#[default]
#[derive(Default)] enum Status { #[default] Active, Inactive, }
For other type of default definition of enums, it can be hard! For example, the following code, can be hard:
#[derive(...)] enum Status { Active, Inactive, } impl Default for Status { fn default() -> Self { serde::from_str("active").unwrap() } }
or:
#[derive(...)] enum Status { Active, Inactive, } impl Default for Status { fn default() -> Self { if env!("ENV") == "prod" { Self::Inactive } else { Self::Active } } }
We can ignore these cases.
The text was updated successfully, but these errors were encountered:
I think it's related to cargo doc itself, not here
cargo doc
Sorry, something went wrong.
No branches or pull requests
Since Rust has introduced
#[default]
, can we hightlight it in the doc?Like this one:
For other type of default definition of enums, it can be hard! For example, the following code, can be hard:
or:
We can ignore these cases.
The text was updated successfully, but these errors were encountered: