aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src
diff options
context:
space:
mode:
Diffstat (limited to 'nitrocli/src')
-rw-r--r--nitrocli/src/commands.rs8
-rw-r--r--nitrocli/src/pinentry.rs4
-rw-r--r--nitrocli/src/tests/mod.rs6
3 files changed, 7 insertions, 11 deletions
diff --git a/nitrocli/src/commands.rs b/nitrocli/src/commands.rs
index f0e0f6e..537a2cf 100644
--- a/nitrocli/src/commands.rs
+++ b/nitrocli/src/commands.rs
@@ -1,7 +1,7 @@
// commands.rs
// *************************************************************************
-// * Copyright (C) 2018-2019 Daniel Mueller (deso@posteo.net) *
+// * Copyright (C) 2018-2020 Daniel Mueller (deso@posteo.net) *
// * *
// * This program is free software: you can redistribute it and/or modify *
// * it under the terms of the GNU General Public License as published by *
@@ -949,11 +949,7 @@ pub fn pws_status(ctx: &mut args::ExecCtx<'_>, all: bool) -> Result<()> {
.get_slot_status()
.map_err(|err| get_error("Could not read PWS slot status", err))?;
println!(ctx, "slot\tname")?;
- for (i, &value) in slots
- .into_iter()
- .enumerate()
- .filter(|(_, &value)| all || value)
- {
+ for (i, &value) in slots.iter().enumerate().filter(|(_, &value)| all || value) {
print_pws_slot(ctx, &pws, i, value)?;
}
Ok(())
diff --git a/nitrocli/src/pinentry.rs b/nitrocli/src/pinentry.rs
index af28e2d..fd47657 100644
--- a/nitrocli/src/pinentry.rs
+++ b/nitrocli/src/pinentry.rs
@@ -1,7 +1,7 @@
// pinentry.rs
// *************************************************************************
-// * Copyright (C) 2017-2019 Daniel Mueller (deso@posteo.net) *
+// * Copyright (C) 2017-2020 Daniel Mueller (deso@posteo.net) *
// * *
// * This program is free software: you can redistribute it and/or modify *
// * it under the terms of the GNU General Public License as published by *
@@ -357,7 +357,7 @@ mod tests {
let response = "ERR ".to_string() + error + "\n";
let expected = error;
- let error = parse_pinentry_pin(response.to_string());
+ let error = parse_pinentry_pin(response);
if let Error::Error(ref e) = error.err().unwrap() {
assert_eq!(e, &expected);
diff --git a/nitrocli/src/tests/mod.rs b/nitrocli/src/tests/mod.rs
index 1e2fe26..5ebf285 100644
--- a/nitrocli/src/tests/mod.rs
+++ b/nitrocli/src/tests/mod.rs
@@ -1,7 +1,7 @@
// mod.rs
// *************************************************************************
-// * Copyright (C) 2019 Daniel Mueller (deso@posteo.net) *
+// * Copyright (C) 2019-2020 Daniel Mueller (deso@posteo.net) *
// * *
// * This program is free software: you can redistribute it and/or modify *
// * it under the terms of the GNU General Public License as published by *
@@ -139,10 +139,10 @@ impl Nitrocli {
F: FnOnce(&mut crate::RunCtx<'_>, Vec<String>) -> R,
{
let args = ["nitrocli"]
- .into_iter()
+ .iter()
.cloned()
.chain(self.model.map(Self::model_to_arg))
- .chain(args.into_iter().cloned())
+ .chain(args.iter().cloned())
.map(ToOwned::to_owned)
.collect();