From 1940b00132853171717207ff1e8309bb7b6057e8 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 25 May 2022 13:19:17 +1000 Subject: [PATCH] Implement From instead of Into Implementing `From` gives us an implementation of `Into` for free so is therefore superior. Found by Clippy. --- src/network/constants.rs | 6 +++--- src/util/bip32.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/network/constants.rs b/src/network/constants.rs index 8ccc22cc..4b185ee6 100644 --- a/src/network/constants.rs +++ b/src/network/constants.rs @@ -238,9 +238,9 @@ impl From for ServiceFlags { } } -impl Into for ServiceFlags { - fn into(self) -> u64 { - self.0 +impl From for u64 { + fn from(flags: ServiceFlags) -> Self { + flags.0 } } diff --git a/src/util/bip32.rs b/src/util/bip32.rs index 0bc23c64..eff83c78 100644 --- a/src/util/bip32.rs +++ b/src/util/bip32.rs @@ -283,9 +283,9 @@ impl From> for DerivationPath { } } -impl Into> for DerivationPath { - fn into(self) -> Vec { - self.0 +impl From for Vec { + fn from(path: DerivationPath) -> Self { + path.0 } }