Skip to content

Commit

Permalink
Change Into<_> traits to From<_> in all types
Browse files Browse the repository at this point in the history
  • Loading branch information
ya7on committed Nov 21, 2023
1 parent 3fc0cb1 commit 785ce4e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ impl From<bool> for MCBoolean {
}
}

impl Into<bool> for MCBoolean {
fn into(self) -> bool {
self.0
impl From<MCBoolean> for bool {
fn from(value: MCBoolean) -> Self {
value.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ impl From<i8> for MCByte {
}
}

impl Into<i8> for MCByte {
fn into(self) -> i8 {
self.0
impl From<MCByte> for i8 {
fn from(value: MCByte) -> Self {
value.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/long.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use std::io::Read;
#[derive(Debug, Clone)]
pub struct MCLong(i64);

impl Into<i64> for MCLong {
fn into(self) -> i64 {
self.0
impl From<MCLong> for i64 {
fn from(value: MCLong) -> Self {
value.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ impl From<&str> for MCString {
}
}

impl Into<String> for MCString {
fn into(self) -> String {
self.0
impl From<MCString> for String {
fn from(value: MCString) -> Self {
value.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/ubyte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ impl From<u8> for MCUByte {
}
}

impl Into<u8> for MCUByte {
fn into(self) -> u8 {
self.0
impl From<MCUByte> for u8 {
fn from(value: MCUByte) -> Self {
value.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/ushort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ impl From<u16> for MCUShort {
}
}

impl Into<u16> for MCUShort {
fn into(self) -> u16 {
self.0
impl From<MCUShort> for u16 {
fn from(value: MCUShort) -> Self {
value.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ impl From<Uuid> for MCUuid {
}
}

impl Into<Uuid> for MCUuid {
fn into(self) -> Uuid {
self.0
impl From<MCUuid> for Uuid {
fn from(value: MCUuid) -> Self {
value.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions mclib/protocol/src/types/varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ impl From<i32> for MCVarInt {
}
}

impl Into<i32> for MCVarInt {
fn into(self) -> i32 {
self.0
impl From<MCVarInt> for i32 {
fn from(value: MCVarInt) -> Self {
value.0
}
}

Expand Down

0 comments on commit 785ce4e

Please sign in to comment.