Skip to content

Question about fibonacci example #27

Description

@gembin

If remove end attribute from fn fibonacci, it always match Silent although there is start attribute. Is this example working properly or it's the expected behavior?

I'm expecting if only specify start attribute, it should match EzTraceArgs::Start

#[derive(AttrArgs)]
enum EzTraceArgs {
    StartAndEnd { start: String, end: String },
    Start { start: String },
    End { end: String },
    Silent,
}

#[ez_trace(start = "{name}({args})")]
fn fibonacci(n: u32) -> u32 {
    if n == 0 || n == 1 {
        n
    } else {
        fibonacci(n - 1) + fibonacci(n - 2)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions