From 5963bfe00e3e38f55daacc22dc0eefc66ff8e173 Mon Sep 17 00:00:00 2001 From: Jacob Firek Date: Tue, 11 Jul 2023 11:15:07 -0700 Subject: [PATCH 1/2] fixing return types in documentation --- primitives/core/src/crypto.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/primitives/core/src/crypto.rs b/primitives/core/src/crypto.rs index 800942065f558..77c9cc309e2e4 100644 --- a/primitives/core/src/crypto.rs +++ b/primitives/core/src/crypto.rs @@ -872,7 +872,7 @@ pub trait Pair: CryptoType + Sized + Clone + Send + Sync + 'static { (pair, phrase.to_owned(), seed) } - /// Returns the KeyPair from the English BIP39 seed `phrase`, or `None` if it's invalid. + /// Returns the KeyPair from the English BIP39 seed `phrase`, or an error if it's invalid. #[cfg(feature = "std")] fn from_phrase( phrase: &str, @@ -907,7 +907,7 @@ pub trait Pair: CryptoType + Sized + Clone + Send + Sync + 'static { } /// Make a new key pair from secret seed material. The slice must be the correct size or - /// it will return `None`. + /// an error will be returned. /// /// @WARNING: THIS WILL ONLY BE SECURE IF THE `seed` IS SECURE. If it can be guessed /// by an attacker then they can also derive your key. @@ -950,7 +950,7 @@ pub trait Pair: CryptoType + Sized + Clone + Send + Sync + 'static { /// Similarly an empty password (ending the SURI with `///`) is perfectly valid and will /// generally be equivalent to no password at all. /// - /// `None` is returned if no matches are found. + /// an error is returned if no matches are found. #[cfg(feature = "std")] fn from_string_with_seed( s: &str, From 323ac6b9d0f925a3dda2bd22764ad240f8e64a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 14 Jul 2023 20:42:47 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- primitives/core/src/crypto.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/primitives/core/src/crypto.rs b/primitives/core/src/crypto.rs index 77c9cc309e2e4..72f996b336832 100644 --- a/primitives/core/src/crypto.rs +++ b/primitives/core/src/crypto.rs @@ -949,8 +949,6 @@ pub trait Pair: CryptoType + Sized + Clone + Send + Sync + 'static { /// Notably, integer junction indices may be legally prefixed with arbitrary number of zeros. /// Similarly an empty password (ending the SURI with `///`) is perfectly valid and will /// generally be equivalent to no password at all. - /// - /// an error is returned if no matches are found. #[cfg(feature = "std")] fn from_string_with_seed( s: &str,