services/llio: Implement From instead of Into

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
Jean-Pierre De Jesus DIAZ 2022-10-12 15:33:18 +02:00
parent 91e4b9fa15
commit 479694869a
No known key found for this signature in database
GPG key ID: 6279AEC20A9524EC
2 changed files with 12 additions and 12 deletions

View file

@ -27,9 +27,9 @@ impl From<usize> for UartType {
} }
} }
} }
impl Into<usize> for UartType { impl From<UartType> for usize {
fn into(self) -> usize { fn from(uart_type: UartType) -> usize {
match self { match uart_type {
UartType::Kernel => 0, UartType::Kernel => 0,
UartType::Log => 1, UartType::Log => 1,
UartType::Application => 2, UartType::Application => 2,
@ -38,9 +38,9 @@ impl Into<usize> for UartType {
} }
} }
// for the actual bitmask going to hardware // for the actual bitmask going to hardware
impl Into<u32> for UartType { impl From<UartType> for u32 {
fn into(self) -> u32 { fn from(uart_type: UartType) -> u32 {
match self { match uart_type {
UartType::Kernel => 0, UartType::Kernel => 0,
UartType::Log => 1, UartType::Log => 1,
UartType::Application => 2, UartType::Application => 2,

View file

@ -15,9 +15,9 @@ impl From<usize> for VibePattern {
} }
} }
} }
impl Into<usize> for VibePattern { impl From<VibePattern> for usize {
fn into(self) -> usize { fn from(pat: VibePattern) -> usize {
match self { match pat {
VibePattern::Long => 0, VibePattern::Long => 0,
VibePattern::Double => 1, VibePattern::Double => 1,
VibePattern::Short => 0xffff_ffff, VibePattern::Short => 0xffff_ffff,
@ -39,9 +39,9 @@ impl From<usize> for ClockMode {
} }
} }
} }
impl Into<usize> for ClockMode { impl From<ClockMode> for usize {
fn into(self) -> usize { fn from(mode: ClockMode) -> usize {
match self { match mode {
ClockMode::Low => 0, ClockMode::Low => 0,
ClockMode::AllOn => 0xffff_ffff, ClockMode::AllOn => 0xffff_ffff,
} }