Skip to content

Commit

Permalink
Add doc-comment for get_fields
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
  • Loading branch information
zachs18 and danielhenrymantilla authored Sep 16, 2024
1 parent b5ac207 commit 4dc453a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions derive/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ fn get_struct_fields(input: &DeriveInput) -> Result<&Fields> {
}
}

/// Extract the `Fields` off a `DeriveInput`, or, in the `enum` case, off
/// those of the `enum_variant`, when provided (e.g., for `Zeroable`).
///
/// We purposely allow not providing an `enum_variant` for cases where
/// the caller wants to reject supporting `enum`s (e.g., `NoPadding`).
fn get_fields(
input: &DeriveInput, enum_variant: Option<&Variant>,
) -> Result<Fields> {
Expand Down

0 comments on commit 4dc453a

Please sign in to comment.