From f4b6d30940a7a13d7850d99adea8c2d94175100b Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Tue, 10 Feb 2026 03:25:55 +0100 Subject: chore(deps): Update to tiny-bip39 2.0.0 (#3151) ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing I don't know why the previous PR https://github.com/atuinsh/atuin/pull/2643 got auto-closed after a rebase, so I am re-creating it. --- crates/atuin-client/src/login.rs | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'crates/atuin-client/src') diff --git a/crates/atuin-client/src/login.rs b/crates/atuin-client/src/login.rs index ab265928..d72d1c09 100644 --- a/crates/atuin-client/src/login.rs +++ b/crates/atuin-client/src/login.rs @@ -23,24 +23,16 @@ pub async fn login( let key = match bip39::Mnemonic::from_phrase(&key, bip39::Language::English) { Ok(mnemonic) => encode_key(Key::from_slice(mnemonic.entropy()))?, Err(err) => { - match err.downcast_ref::() { - Some(err) => { - match err { - // assume they copied in the base64 key - bip39::ErrorKind::InvalidWord => key, - bip39::ErrorKind::InvalidChecksum => { - bail!("key mnemonic was not valid") - } - bip39::ErrorKind::InvalidKeysize(_) - | bip39::ErrorKind::InvalidWordLength(_) - | bip39::ErrorKind::InvalidEntropyLength(_, _) => { - bail!("key was not the correct length") - } - } + match err { + // assume they copied in the base64 key + bip39::ErrorKind::InvalidWord(_) => key, + bip39::ErrorKind::InvalidChecksum => { + bail!("key mnemonic was not valid") } - _ => { - // unknown error. assume they copied the base64 key - key + bip39::ErrorKind::InvalidKeysize(_) + | bip39::ErrorKind::InvalidWordLength(_) + | bip39::ErrorKind::InvalidEntropyLength(_, _) => { + bail!("key was not the correct length") } } } -- cgit v1.3.1