keyfork-derive-path-data: make clippy happy

This commit is contained in:
Ryan Heywood 2024-01-06 23:19:47 -05:00
parent 2aba00c457
commit 91a6b845ba
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
#![allow(clippy::unreadable_literal)]
use keyfork_derive_util::{DerivationIndex, DerivationPath}; use keyfork_derive_util::{DerivationIndex, DerivationPath};
pub static OPENPGP: DerivationIndex = DerivationIndex::new_unchecked(7366512, true); pub static OPENPGP: DerivationIndex = DerivationIndex::new_unchecked(7366512, true);
@ -19,7 +21,7 @@ impl std::fmt::Display for Target {
/// Determine the closest [`Target`] for the given path. This method is intended to be used by /// Determine the closest [`Target`] for the given path. This method is intended to be used by
/// `keyforkd` to provide an optional textual prompt to what a client is attempting to derive. /// `keyforkd` to provide an optional textual prompt to what a client is attempting to derive.
pub fn guess_target(path: &DerivationPath) -> Option<Target> { pub fn guess_target(path: &DerivationPath) -> Option<Target> {
Some(match Vec::from_iter(path.iter())[..] { Some(match path.iter().collect::<Vec<_>>()[..] {
[t, index] if t == &OPENPGP => Target::OpenPGP(index.clone()), [t, index] if t == &OPENPGP => Target::OpenPGP(index.clone()),
_ => return None, _ => return None,
}) })