From c8d2ab1d4c2b4f4bffc537cb0f0c4e424c306378 Mon Sep 17 00:00:00 2001 From: DustInDark Date: Tue, 7 Jun 2022 20:16:28 +0900 Subject: [PATCH] fixed cargo clippy error --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index cb18dec4..aae3f64b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -152,7 +152,8 @@ impl App { } if let Some(csv_path) = configs::CONFIG.read().unwrap().args.value_of("output") { - for (key, _) in PIVOT_KEYWORD.read().unwrap().iter() { + let pivot_key_unions = PIVOT_KEYWORD.read().unwrap().clone(); + for (key, _) in pivot_key_unions.iter() { let keywords_file_name = csv_path.to_owned() + "-" + key + ".txt"; if Path::new(&keywords_file_name).exists() { AlertMessage::alert(&format!( @@ -320,14 +321,17 @@ impl App { //output to stdout let mut output = "Pivot keyword results saved to the following files:\n".to_string(); - for (key, _) in PIVOT_KEYWORD.read().unwrap().iter() { + let pivot_key_unions = PIVOT_KEYWORD.read().unwrap().clone(); + + for (key, _) in pivot_key_unions.iter() { output += &(pivot_file.to_owned() + "-" + key + ".txt" + "\n"); } write_color_buffer(BufferWriter::stdout(ColorChoice::Always), None, &output).ok(); } else { //標準出力の場合 let mut output = "The following pivot keywords were found:\n".to_string(); - for (key, pivot_keyword) in PIVOT_KEYWORD.read().unwrap().iter() { + let pivot_key_unions = PIVOT_KEYWORD.read().unwrap().clone(); + for (key, pivot_keyword) in pivot_key_unions.iter() { output += &format!("{}: ", key).to_string(); output += "( ";