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 {
fn into(self) -> usize {
match self {
impl From<UartType> 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<usize> for UartType {
}
}
// for the actual bitmask going to hardware
impl Into<u32> for UartType {
fn into(self) -> u32 {
match self {
impl From<UartType> for u32 {
fn from(uart_type: UartType) -> u32 {
match uart_type {
UartType::Kernel => 0,
UartType::Log => 1,
UartType::Application => 2,

View file

@ -15,9 +15,9 @@ impl From<usize> for VibePattern {
}
}
}
impl Into<usize> for VibePattern {
fn into(self) -> usize {
match self {
impl From<VibePattern> 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<usize> for ClockMode {
}
}
}
impl Into<usize> for ClockMode {
fn into(self) -> usize {
match self {
impl From<ClockMode> for usize {
fn from(mode: ClockMode) -> usize {
match mode {
ClockMode::Low => 0,
ClockMode::AllOn => 0xffff_ffff,
}