Skip to content

Commit ffb7cf7

Browse files
committed
remove base16_decode
1 parent d5311c0 commit ffb7cf7

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

fido-key-manager/src/main.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,6 @@ pub struct CliParser {
216216
pub commands: Opt,
217217
}
218218

219-
pub fn base16_decode(s: &str) -> Option<Vec<u8>> {
220-
if s.len() % 2 != 0 {
221-
return None;
222-
}
223-
(0..s.len())
224-
.step_by(2)
225-
.map(|i| u8::from_str_radix(&s[i..i + 2], 16))
226-
.collect::<Result<Vec<_>, _>>()
227-
.ok()
228-
}
229-
230219
#[tokio::main]
231220
async fn main() {
232221
let opt = CliParser::parse();
@@ -416,7 +405,7 @@ async fn main() {
416405
token
417406
.bio()
418407
.unwrap()
419-
.rename_fingerprint(base16_decode(&o.id).expect("decoding ID"), o.friendly_name)
408+
.rename_fingerprint(hex::decode(&o.id).expect("decoding ID"), o.friendly_name)
420409
.await
421410
.expect("renaming fingerprint");
422411
}
@@ -429,7 +418,7 @@ async fn main() {
429418

430419
let ids: Vec<Vec<u8>> =
431420
o.id.iter()
432-
.map(|i| base16_decode(i).expect("decoding ID"))
421+
.map(|i| hex::decode(i).expect("decoding ID"))
433422
.collect();
434423
token
435424
.bio()

0 commit comments

Comments
 (0)