Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Dewes <[email protected]>
  • Loading branch information
AaronDewes committed May 19, 2024
1 parent 251547f commit 6e2ec14
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ struct Kopium {
/// Type used to represent maps via additionalProperties
#[arg(long, value_enum, default_value_t)]
map_type: MapType,

/// Always add #[derive(Default)] to structs, even if it can't be derived without a manual impl for some fields
///
///
/// This option only has an effect if `--derive Default` is set.
#[arg(long)]
force_derive_default: bool,
Expand Down Expand Up @@ -274,7 +274,10 @@ impl Kopium {
if derive.derived_trait == "JsonSchema" {
continue;
}
if derive.derived_trait == "Default" && !self.force_derive_default && !s.can_derive_default(&structs) {
if derive.derived_trait == "Default"
&& !self.force_derive_default
&& !s.can_derive_default(&structs)
{
continue;
}
println!(r#"#[kube(derive="{}")]"#, derive.derived_trait);
Expand Down

0 comments on commit 6e2ec14

Please sign in to comment.