You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…142, #239)
Resolves#142, #239
## Synopsis
This adds back support for top-level format strings of the Display
derive. It
now includes the display of the variant whenever the `_variant`
placeholder
appears be found. It also supports using the field.
## Solution
This does not include the same support for Debug, since it is considered
much less
useful there and the differences between the Debug implementation and
Display
implementation make it a non-trivial port.
Only named arguments are supported in the format string, no positional
ones.
This made the implementation easier, maybe in a future PR positional
support
can be added.
This bumps MSRV to 1.70.0, on earlier versions the derived code throws
the following error:
```rust
error: there is no argument named `_0`
--> tests/display.rs:1373:26
|
1373 | #[derive(Display)]
| ^^^^^^^
|
= note: did you intend to capture a variable `_0` from the surrounding scope?
= note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
= note: this error originates in the derive macro `Display` (in Nightly builds, run with -Z macro-backtrace for more info)
```
Co-authored-by: Kai Ren <[email protected]>
Awesome library, i like it!
I found some small problems during use, in some cases, it will be panic. The following is an example:
Here is the compile error result:
I can't find the cause of the problem from the message.
The text was updated successfully, but these errors were encountered: