Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Dec 30, 2024
1 parent 8c8b5ae commit a72f867
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions impl/doc/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ then it acts as the default one for the variants without its own format.
enum Enum {
#[display("A {_0}")]
A(i32),
B { field: i32 },
B(u32),
#[display("c")]
C,
}

assert_eq!(Enum::A(1).to_string(), "A 1");
assert_eq!(Enum::B { field: 2 }.to_string(), "Variant: 2 & 2");
assert_eq!(Enum::B(2).to_string(), "Variant: 2 & 2");
assert_eq!(Enum::C.to_string(), "c");
```

Expand Down

0 comments on commit a72f867

Please sign in to comment.