From 1e5acefff6c9c56125ad186620bfe03f982f381f Mon Sep 17 00:00:00 2001 From: Vivian Roest Date: Tue, 2 May 2023 09:04:52 +0200 Subject: [PATCH] fix bug --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 361a41c..9a0b185 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,6 @@ use std::{env, fs::File}; use tracing::{info, subscriber, warn}; use tracing_subscriber::FmtSubscriber; use ureq::Error::Status; -use ureq::Response; #[derive(Debug, Deserialize)] struct KeyFile { @@ -56,7 +55,7 @@ fn is_sealed(health_url: &str) -> bool { } fn unseal(keyfile: &KeyFile, unseal_url: &str) { - for key in keyfile.keys.iter().enumerate() { + for key in keyfile.keys.iter() { match ureq::post(unseal_url).send_json(json!({ "key": key })) { Ok(resp) if resp.status() == 200 => { if let Ok(UnsealResponse { @@ -73,7 +72,7 @@ fn unseal(keyfile: &KeyFile, unseal_url: &str) { info!("unsealed vault partially {progress}/{t}"); } } - Ok(resp) => warn!( + Ok(resp) | Err(Status(_, resp)) => warn!( "error unsealing vault, got code '{}', with message: {}", resp.status(), resp.status_text()