From 3148d18363245439467dbdf3443a03f4423a41b9 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Sat, 25 Jul 2020 10:04:24 -0400 Subject: [PATCH] Prefer implementing From instead of Into --- src/register.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/register.rs b/src/register.rs index 2a13f98..36927de 100644 --- a/src/register.rs +++ b/src/register.rs @@ -203,12 +203,12 @@ impl ops::Not for RegisterBits where R: Register { } } -impl Into for RegisterBits where R: Register { - fn into(self) -> u8 { self.mask } +impl From> for u8 where R: Register { + fn from(other: RegisterBits) -> u8 { other.mask } } -impl Into for RegisterBits where R: Register { - fn into(self) -> u16 { self.mask } +impl From> for u16 where R: Register { + fn from(other: RegisterBits) -> u16 { other.mask } } impl RegisterValue for u8 { }