From d51ec0a225eb321252ddd1a0aaabf53c52c7580d Mon Sep 17 00:00:00 2001 From: "Tony Arcieri (iqlusion)" Date: Tue, 13 Jul 2021 05:55:24 -0700 Subject: [PATCH] Have `YubiKey::block_puk` take `&mut self` as argument (#289) This is effectively the same signature; it just uses `self` instead of a named argument. --- src/yubikey.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yubikey.rs b/src/yubikey.rs index 68d9693..be96302 100644 --- a/src/yubikey.rs +++ b/src/yubikey.rs @@ -476,12 +476,12 @@ impl YubiKey { /// Block PUK: permanently prevent the PIN from becoming unblocked. #[cfg(feature = "untested")] #[cfg_attr(docsrs, doc(cfg(feature = "untested")))] - pub fn block_puk(yubikey: &mut YubiKey) -> Result<()> { + pub fn block_puk(&mut self) -> Result<()> { let mut puk = [0x30, 0x42, 0x41, 0x44, 0x46, 0x30, 0x30, 0x44]; let mut tries_remaining: i32 = -1; let mut flags = [0]; - let txn = yubikey.begin_transaction()?; + let txn = self.begin_transaction()?; while tries_remaining != 0 { // 2 -> change puk