With the new thiserror version (2.0.3), we can no longer rely on unnamed placeholders `{}`; we must either pass named arguments (e.g., `{named_argument}`) or use explicit positional placeholders (`{0}`, `{1}`) for clarity and correctness.
old code:
`#[error(
"Bad usage of merge: Unknown prefix {0:02x}, expected C or T: {}",
hex::encode(.1),
)]
UnknownOperandPrefix(u8, Vec<u8>),`
The `(.1)` in `hex::encode(.1)` is an ambiguous reference because thiserror is expecting named arguments
and doesn't understand that .1 refers to the second element of the tuple. Therefore, I have named the arguments, so that
its clear to the macro what each argument corresponds to.
new code:
`#[error(
"Bad usage of merge: Unknown prefix {prefix:02x},
expected C or T: {encoded}",
prefix = .0,
encoded = hex::encode(.1),
)]
UnknownOperandPrefix(u8, Vec<u8>), `
Here, we have made it explicit what .1 refers to, by passing it into a variable and passing it in as an argument into the placeholders.