Im implementing the Display trait for an enum, to be passed as a trait constraint for a generic type, is there anything I am doing wrong? It keeps raising errors on the codebase
You haven't posted the error so it's hard to help you.
Though the first thin I notice is that you're not passing f to the write! macro.
Compare your code to the Example and you should see the problem.
error: unexpected end of macro invocation
--> src/lib.rs:5:28
|
5 | S => write!("S"),
| ^ missing tokens in macro arguments
|
note: while trying to match `,`
--> /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/macros/mod.rs:611:15
|
611 | ($dst:expr, $($arg:tt)*) => {
| ^
The error should have at least a note with the first line of the docs: "This macro accepts a ‘writer’, a format string, and a list of arguments." Maybe even a link to the docs as well for some builtin macros.