From 14d91c28d1788ca1636adff739c4ad2c27a48632 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Tue, 10 Nov 2020 10:54:34 +0100 Subject: [PATCH] Reformat code with rust fmt Signed-off-by: Patrick Uiterwijk --- src/cli.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 353c6cc..fd87991 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -132,16 +132,18 @@ impl TPM2Config { let newvals: Result, _> = vals .iter() .map(|x| match x { - serde_json::Value::String(val) => match val.trim().parse::() { - Ok(res) => { - let new = serde_json::Value::Number(res); - if !new.is_u64() { - return Err("Non-positive string int"); + serde_json::Value::String(val) => { + match val.trim().parse::() { + Ok(res) => { + let new = serde_json::Value::Number(res); + if !new.is_u64() { + return Err("Non-positive string int"); + } + Ok(new) } - Ok(new) + Err(_) => Err("Unparseable string int"), } - Err(_) => Err("Unparseable string int"), - }, + } serde_json::Value::Number(n) => { let new = serde_json::Value::Number(n.clone()); if !new.is_u64() {