aboutsummaryrefslogtreecommitdiff
path: root/minecraft-protocol/src/packets/handshake
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-12-10 16:16:59 +0000
committermat <github@matdoes.dev>2021-12-10 16:16:59 +0000
commitf6a3f088ac1cd9526e6b93e03ea9929658478565 (patch)
treecbed70ca68f6009a7efe4c958e730ec9229ee4cf /minecraft-protocol/src/packets/handshake
parentbe762fc5d37ba48386996afb4c5ba0c94aaf5883 (diff)
downloadazalea-drasl-f6a3f088ac1cd9526e6b93e03ea9929658478565.tar.xz
it compiles
Diffstat (limited to 'minecraft-protocol/src/packets/handshake')
-rw-r--r--minecraft-protocol/src/packets/handshake/client_intention_packet.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/minecraft-protocol/src/packets/handshake/client_intention_packet.rs b/minecraft-protocol/src/packets/handshake/client_intention_packet.rs
index 401dbbac..0f14ed48 100644
--- a/minecraft-protocol/src/packets/handshake/client_intention_packet.rs
+++ b/minecraft-protocol/src/packets/handshake/client_intention_packet.rs
@@ -8,19 +8,19 @@ use crate::{
packets::{ConnectionProtocol, Packet, PacketTrait},
};
-#[derive(Hash)]
-pub struct ClientIntentionPacket<'a> {
+#[derive(Hash, Clone)]
+pub struct ClientIntentionPacket {
pub protocol_version: u32,
- pub hostname: &'a String,
+ pub hostname: String,
pub port: u16,
/// 1 for status, 2 for login
pub intention: ConnectionProtocol,
}
#[async_trait]
-impl<'a> PacketTrait for ClientIntentionPacket<'a> {
- fn get(&self) -> Packet {
- Packet::ClientIntentionPacket(*self)
+impl PacketTrait for ClientIntentionPacket {
+ fn get(self) -> Packet {
+ Packet::ClientIntentionPacket(self)
}
fn write(&self, buf: &mut Vec<u8>) {
@@ -32,7 +32,7 @@ impl<'a> PacketTrait for ClientIntentionPacket<'a> {
async fn read<T: tokio::io::AsyncRead + std::marker::Unpin + std::marker::Send>(
buf: &mut BufReader<T>,
- ) -> Result<Packet<'_>, String> {
+ ) -> Result<Packet, String> {
Err("ClientIntentionPacket::parse not implemented".to_string())
// Ok(ClientIntentionPacket {}.get())
}