Skip to content

Commit

Permalink
Prefer "from" trait instead of "into" trait
Browse files Browse the repository at this point in the history
  • Loading branch information
hasenbanck committed Dec 27, 2024
1 parent d674b1e commit 9507e02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions korangar/src/interface/cursor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub enum MouseCursorState {
Unsure3,
}

impl Into<usize> for MouseCursorState {
fn into(self) -> usize {
self as usize
impl From<MouseCursorState> for usize {
fn from(value: MouseCursorState) -> Self {
value as usize
}
}

Expand Down
6 changes: 3 additions & 3 deletions korangar/src/loaders/action/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ pub enum ActionType {
Dead = 8,
}

impl Into<usize> for ActionType {
fn into(self) -> usize {
self as usize
impl From<ActionType> for usize {
fn from(value: ActionType) -> Self {
value as usize
}
}

Expand Down

0 comments on commit 9507e02

Please sign in to comment.