diff --git a/protocol/src/protocol/mod.rs b/protocol/src/protocol/mod.rs index ba2d9f8..1e16cc5 100644 --- a/protocol/src/protocol/mod.rs +++ b/protocol/src/protocol/mod.rs @@ -405,7 +405,7 @@ impl LenPrefixed { pub fn new(data: Vec) -> LenPrefixed { LenPrefixed { len: Default::default(), - data: data, + data, } } } @@ -420,7 +420,7 @@ impl Serializable for LenPrefixed { } Result::Ok(LenPrefixed { len: len_data, - data: data, + data, }) } @@ -461,7 +461,7 @@ impl LenPrefixedBytes { pub fn new(data: Vec) -> LenPrefixedBytes { LenPrefixedBytes { len: Default::default(), - data: data, + data, } } } @@ -474,7 +474,7 @@ impl Serializable for LenPrefixedBytes { buf.take(len as u64).read_to_end(&mut data)?; Result::Ok(LenPrefixedBytes { len: len_data, - data: data, + data, }) } @@ -765,7 +765,7 @@ impl Conn { }; let stream = TcpStream::connect(&*address)?; Result::Ok(Conn { - stream: stream, + stream, host: parts[0].to_owned(), port: parts[1].parse().unwrap(), direction: Direction::Serverbound, @@ -875,8 +875,8 @@ impl Conn { let port = self.port; self.write_packet(Handshake { protocol_version: VarInt(SUPPORTED_PROTOCOL), - host: host, - port: port, + host, + port, next: VarInt(1), })?; self.state = State::Status; diff --git a/protocol/src/protocol/packet.rs b/protocol/src/protocol/packet.rs index ea97def..b491cd0 100644 --- a/protocol/src/protocol/packet.rs +++ b/protocol/src/protocol/packet.rs @@ -1121,8 +1121,8 @@ impl Serializable for PlayerInfoData { props.push(prop); } let p = PlayerDetail::Add { - uuid: uuid, - name: name, + uuid, + name, properties: props, gamemode: Serializable::read_from(buf)?, ping: Serializable::read_from(buf)?, @@ -1138,19 +1138,19 @@ impl Serializable for PlayerInfoData { } 1 => { m.players.push(PlayerDetail::UpdateGamemode { - uuid: uuid, + uuid, gamemode: Serializable::read_from(buf)?, }) } 2 => { m.players.push(PlayerDetail::UpdateLatency { - uuid: uuid, + uuid, ping: Serializable::read_from(buf)?, }) } 3 => { m.players.push(PlayerDetail::UpdateDisplayName { - uuid: uuid, + uuid, display: { if bool::read_from(buf)? { Some(Serializable::read_from(buf)?)