Skip to content

Commit

Permalink
replace Into with From
Browse files Browse the repository at this point in the history
  • Loading branch information
Guy Garcia committed Feb 24, 2023
1 parent fc382ef commit fe30945
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ pub enum PortState {
Disabled,
}

impl Into<bool> for PortState {
fn into(self) -> bool {
match self {
PortState::Enabled => true,
PortState::Disabled => false,
impl From<bool> for PortState {
fn from(value: bool) -> Self {
match value {
true => PortState::Enabled,
false => PortState::Disabled,
}
}
}
Expand Down

0 comments on commit fe30945

Please sign in to comment.