Add documentation for #[cfg] work-around on expressions

This commit is contained in:
Julien Cretin
2022-03-28 15:29:15 +02:00
parent 0f073f8f54
commit 6e2f076e24

View File

@@ -542,6 +542,8 @@ impl CtapState {
// Correct behavior between CTAP1 and CTAP2 isn't defined yet. Just a guess. // Correct behavior between CTAP1 and CTAP2 isn't defined yet. Just a guess.
#[cfg(feature = "with_ctap1")] #[cfg(feature = "with_ctap1")]
{ {
// We create a block statement to wrap this assignment expression, because attributes
// (like #[cfg]) are not supported on expressions.
self.u2f_up_state = U2fUserPresenceState::new(U2F_UP_PROMPT_TIMEOUT, TOUCH_TIMEOUT); self.u2f_up_state = U2fUserPresenceState::new(U2F_UP_PROMPT_TIMEOUT, TOUCH_TIMEOUT);
} }
self.stateful_command_permission self.stateful_command_permission