From 09c9fb3a3e5bef0f6df2a6228d8bc716a33ce188 Mon Sep 17 00:00:00 2001 From: Guillaume Endignoux Date: Mon, 22 Jun 2020 10:43:36 +0200 Subject: [PATCH] Apply suggestion to remove additional semi-colons. --- libraries/cbor/src/macros.rs | 10 +++++----- src/ctap/command.rs | 6 +++--- src/ctap/data_formats.rs | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libraries/cbor/src/macros.rs b/libraries/cbor/src/macros.rs index 1bc37e2..d96354e 100644 --- a/libraries/cbor/src/macros.rs +++ b/libraries/cbor/src/macros.rs @@ -48,7 +48,7 @@ use core::iter::Peekable; /// 1 => x, /// "key" => y, /// } = map; -/// }; +/// } /// # } /// ``` /// @@ -653,7 +653,7 @@ mod test { 1 => x1, 2 => x2, } = extract_map(map); - }; + } assert_eq!(x1, Some(cbor_unsigned!(10))); assert_eq!(x2, Some(cbor_unsigned!(20))); @@ -674,7 +674,7 @@ mod test { 2 => _x2, 1 => _x1, } = extract_map(map); - }; + } } #[test] @@ -696,7 +696,7 @@ mod test { 3 => x3, 7 => x7, } = extract_map(map); - }; + } assert_eq!(x3, Some(cbor_unsigned!(30))); assert_eq!(x7, Some(cbor_unsigned!(70))); @@ -719,7 +719,7 @@ mod test { 4 => x4, 5 => x5, } = extract_map(map); - }; + } assert_eq!(x0, None); assert_eq!(x1, Some(cbor_unsigned!(10))); diff --git a/src/ctap/command.rs b/src/ctap/command.rs index d993704..9f0e20b 100644 --- a/src/ctap/command.rs +++ b/src/ctap/command.rs @@ -136,7 +136,7 @@ impl TryFrom for AuthenticatorMakeCredentialParameters { 8 => pin_uv_auth_param, 9 => pin_uv_auth_protocol, } = extract_map(cbor_value)?; - }; + } let client_data_hash = extract_byte_string(ok_or_missing(client_data_hash)?)?; let rp = PublicKeyCredentialRpEntity::try_from(ok_or_missing(rp)?)?; @@ -217,7 +217,7 @@ impl TryFrom for AuthenticatorGetAssertionParameters { 6 => pin_uv_auth_param, 7 => pin_uv_auth_protocol, } = extract_map(cbor_value)?; - }; + } let rp_id = extract_text_string(ok_or_missing(rp_id)?)?; let client_data_hash = extract_byte_string(ok_or_missing(client_data_hash)?)?; @@ -286,7 +286,7 @@ impl TryFrom for AuthenticatorClientPinParameters { 5 => new_pin_enc, 6 => pin_hash_enc, } = extract_map(cbor_value)?; - }; + } let pin_protocol = extract_unsigned(ok_or_missing(pin_protocol)?)?; let sub_command = ClientPinSubCommand::try_from(ok_or_missing(sub_command)?)?; diff --git a/src/ctap/data_formats.rs b/src/ctap/data_formats.rs index e21e859..b5799b4 100644 --- a/src/ctap/data_formats.rs +++ b/src/ctap/data_formats.rs @@ -37,7 +37,7 @@ impl TryFrom for PublicKeyCredentialRpEntity { "icon" => rp_icon, "name" => rp_name, } = extract_map(cbor_value)?; - }; + } let rp_id = extract_text_string(ok_or_missing(rp_id)?)?; let rp_name = rp_name.map(extract_text_string).transpose()?; @@ -71,7 +71,7 @@ impl TryFrom for PublicKeyCredentialUserEntity { "name" => user_name, "displayName" => user_display_name, } = extract_map(cbor_value)?; - }; + } let user_id = extract_byte_string(ok_or_missing(user_id)?)?; let user_name = user_name.map(extract_text_string).transpose()?; @@ -148,7 +148,7 @@ impl TryFrom for PublicKeyCredentialParameter { "alg" => alg, "type" => cred_type, } = extract_map(cbor_value)?; - }; + } let cred_type = PublicKeyCredentialType::try_from(ok_or_missing(cred_type)?)?; let alg = SignatureAlgorithm::try_from(ok_or_missing(alg)?)?; @@ -219,7 +219,7 @@ impl TryFrom for PublicKeyCredentialDescriptor { "type" => key_type, "transports" => transports, } = extract_map(cbor_value)?; - }; + } let key_type = PublicKeyCredentialType::try_from(ok_or_missing(key_type)?)?; let key_id = extract_byte_string(ok_or_missing(key_id)?)?; @@ -268,7 +268,7 @@ impl TryFrom for MakeCredentialExtensions { "credProtect" => cred_protect, "hmac-secret" => hmac_secret, } = extract_map(cbor_value)?; - }; + } let hmac_secret = hmac_secret.map_or(Ok(false), extract_bool)?; let cred_protect = cred_protect @@ -294,7 +294,7 @@ impl TryFrom for GetAssertionExtensions { let { "hmac-secret" => hmac_secret, } = extract_map(cbor_value)?; - }; + } let hmac_secret = hmac_secret .map(GetAssertionHmacSecretInput::try_from) @@ -320,7 +320,7 @@ impl TryFrom for GetAssertionHmacSecretInput { 2 => salt_enc, 3 => salt_auth, } = extract_map(cbor_value)?; - }; + } let cose_key = extract_map(ok_or_missing(cose_key)?)?; let salt_enc = extract_byte_string(ok_or_missing(salt_enc)?)?; @@ -350,7 +350,7 @@ impl TryFrom for MakeCredentialOptions { "up" => up, "uv" => uv, } = extract_map(cbor_value)?; - }; + } let rk = match rk { Some(options_entry) => extract_bool(options_entry)?, @@ -385,7 +385,7 @@ impl TryFrom for GetAssertionOptions { "up" => up, "uv" => uv, } = extract_map(cbor_value)?; - }; + } if let Some(options_entry) = rk { // This is only for returning the correct status code. @@ -552,7 +552,7 @@ impl TryFrom for PublicKeyCredentialSource { CredRandom => cred_random, CredProtectPolicy => cred_protect_policy, } = extract_map(cbor_value)?; - }; + } let credential_id = extract_byte_string(ok_or_missing(credential_id)?)?; let private_key = extract_byte_string(ok_or_missing(private_key)?)?; @@ -651,7 +651,7 @@ impl TryFrom for ecdh::PubKey { -2 => x_bytes, -3 => y_bytes, } = cose_key.0; - }; + } let key_type = extract_integer(ok_or_missing(key_type)?)?; if key_type != EC2_KEY_TYPE {