From 479694869ac32b4a248b93c868aa7ec2c078cb5e Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Wed, 12 Oct 2022 15:33:18 +0200 Subject: [PATCH] services/llio: Implement From instead of Into Signed-off-by: Jean-Pierre De Jesus DIAZ --- services/llio/src/api.rs | 12 ++++++------ services/llio/src/api/llio_api.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/services/llio/src/api.rs b/services/llio/src/api.rs index 34e2642dd..1de2d013d 100644 --- a/services/llio/src/api.rs +++ b/services/llio/src/api.rs @@ -27,9 +27,9 @@ impl From for UartType { } } } -impl Into for UartType { - fn into(self) -> usize { - match self { +impl From for usize { + fn from(uart_type: UartType) -> usize { + match uart_type { UartType::Kernel => 0, UartType::Log => 1, UartType::Application => 2, @@ -38,9 +38,9 @@ impl Into for UartType { } } // for the actual bitmask going to hardware -impl Into for UartType { - fn into(self) -> u32 { - match self { +impl From for u32 { + fn from(uart_type: UartType) -> u32 { + match uart_type { UartType::Kernel => 0, UartType::Log => 1, UartType::Application => 2, diff --git a/services/llio/src/api/llio_api.rs b/services/llio/src/api/llio_api.rs index b5b8d2a72..e35de21b8 100644 --- a/services/llio/src/api/llio_api.rs +++ b/services/llio/src/api/llio_api.rs @@ -15,9 +15,9 @@ impl From for VibePattern { } } } -impl Into for VibePattern { - fn into(self) -> usize { - match self { +impl From for usize { + fn from(pat: VibePattern) -> usize { + match pat { VibePattern::Long => 0, VibePattern::Double => 1, VibePattern::Short => 0xffff_ffff, @@ -39,9 +39,9 @@ impl From for ClockMode { } } } -impl Into for ClockMode { - fn into(self) -> usize { - match self { +impl From for usize { + fn from(mode: ClockMode) -> usize { + match mode { ClockMode::Low => 0, ClockMode::AllOn => 0xffff_ffff, }