Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use former::Former;

/// Generic enum with a unit variant, using Former.
#[derive(Debug, PartialEq, Former)]
#[former(standalone_constructors)]
#[former(standalone_constructors, debug)]
pub enum GenericOption<T: core::fmt::Debug + PartialEq + Clone> // Minimal bounds for T
{
#[scalar] // Treat Value(T) as a scalar constructor for the enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use former::Former; // Ensure derive is in scope
use super::*; // Needed for the include

#[derive(Debug, PartialEq, Former)]
#[former(standalone_constructors)]
#[former(standalone_constructors, debug)]
#[allow(non_camel_case_types)] // Explicitly allowing for testing keyword-like names
pub enum KeywordTest {
r#fn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::*;

/// Enum with a unit variant and a struct-like variant, using Former.
#[derive(Debug, PartialEq, former::Former)]
#[former(standalone_constructors)] // Attribute present, added debug
#[former(standalone_constructors, debug)] // Attribute present, added debug
pub enum MixedEnum
{
SimpleUnit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct InnerForSubform

// The enum under test for zero-field tuple variants with #[derive(Former)]
#[ derive( Debug, PartialEq, Former ) ]
#[former(standalone_constructors)] // debug attribute commented out // Added standalone_constructors and debug
#[former(standalone_constructors, debug)] // Added standalone_constructors and debug
// #[ derive( Default ) ] // Do not derive Default here, it caused issues before.
pub enum EnumWithZeroFieldTuple
{
Expand Down
4 changes: 2 additions & 2 deletions module/core/former_meta/src/derive_former/former_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ pub(super) fn former_for_enum

// Diagnostic print for has_debug status (has_debug is now correctly determined by the caller)
if has_debug {
diag::report_print("DEBUG former_for_enum: has_debug is TRUE at start (passed in).", original_input, &quote!{ struct DebugFlagWasTrue; });
// diag::report_print("DEBUG former_for_enum: has_debug is TRUE at start (passed in).", original_input, &quote!{ struct DebugFlagWasTrue; });
} else {
diag::report_print("DEBUG former_for_enum: has_debug is FALSE at start (passed in).", original_input, &quote!{ struct DebugFlagWasFalse; });
// diag::report_print("DEBUG former_for_enum: has_debug is FALSE at start (passed in).", original_input, &quote!{ struct DebugFlagWasFalse; });
}

let mut methods = Vec::new();
Expand Down