From d8318467061443e7ae9628f5d75e033a35926fa5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 14 Dec 2020 16:32:42 +0100 Subject: [PATCH] tfa: r#type parameter name Signed-off-by: Wolfgang Bumiller --- src/api2/access/tfa.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/api2/access/tfa.rs b/src/api2/access/tfa.rs index e9a512ad..7f46f00f 100644 --- a/src/api2/access/tfa.rs +++ b/src/api2/access/tfa.rs @@ -408,17 +408,15 @@ fn add_tfa_entry( value: Option, challenge: Option, password: Option, - mut params: Value, // FIXME: once api macro supports raw parameters names, use `r#type` + r#type: TfaType, rpcenv: &mut dyn RpcEnvironment, ) -> Result { tfa_update_auth(rpcenv, &userid, password)?; - let tfa_type: TfaType = serde_json::from_value(params["type"].take())?; - let need_description = move || description.ok_or_else(|| format_err!("'description' is required for new entries")); - match tfa_type { + match r#type { TfaType::Totp => match (totp, value) { (Some(totp), Some(value)) => { if challenge.is_some() {