small readbility fix for variable assignment with cfg
This commit is contained in:
@@ -1016,14 +1016,11 @@ mod test {
|
|||||||
let info_reponse = ctap_state.process_command(&[0x04], DUMMY_CHANNEL_ID, DUMMY_CLOCK_VALUE);
|
let info_reponse = ctap_state.process_command(&[0x04], DUMMY_CHANNEL_ID, DUMMY_CLOCK_VALUE);
|
||||||
|
|
||||||
let mut expected_response = vec![0x00, 0xAA, 0x01];
|
let mut expected_response = vec![0x00, 0xAA, 0x01];
|
||||||
// The difference here is a longer array of supported versions.
|
// The version array differs with CTAP1, always including 2.0 and 2.1.
|
||||||
let mut version_count = 0;
|
#[cfg(not(feature = "with_ctap1"))]
|
||||||
// CTAP 2.0 and 2.1 are always supported
|
let version_count = 2;
|
||||||
version_count += 2;
|
|
||||||
#[cfg(feature = "with_ctap1")]
|
#[cfg(feature = "with_ctap1")]
|
||||||
{
|
let version_count = 3;
|
||||||
version_count += 1;
|
|
||||||
}
|
|
||||||
expected_response.push(0x80 + version_count);
|
expected_response.push(0x80 + version_count);
|
||||||
#[cfg(feature = "with_ctap1")]
|
#[cfg(feature = "with_ctap1")]
|
||||||
expected_response.extend(&[0x66, 0x55, 0x32, 0x46, 0x5F, 0x56, 0x32]);
|
expected_response.extend(&[0x66, 0x55, 0x32, 0x46, 0x5F, 0x56, 0x32]);
|
||||||
|
|||||||
Reference in New Issue
Block a user