The router! macro expands to a series of if statements instead of an if ... else if ... else chain or a match statement. This means that the compiler cannot tell that only a single handler can run, and so the compiler will complain about values being used multiple times if they are moved into route handlers.
The
router!
macro expands to a series ofif
statements instead of anif ... else if ... else
chain or a match statement. This means that the compiler cannot tell that only a single handler can run, and so the compiler will complain about values being used multiple times if they are moved into route handlers.