Use Cow's in TextComponent

We now don't always convert &str to Strings allowing us to use stack allocations
This commit is contained in:
Snowiiii committed 2024-08-19 20:05:18 +02:00
1 parent dfc0b8afe9
commit a6d9ed216d
26 files changed
+134 -149

No files matched your search

+1 -1
View File
@@ -375,7 +375,7 @@ impl Client {
.unwrap_or_else(|_| self.close());
}
ConnectionState::Play => {
self.try_send_packet(&CPlayDisconnect::new(TextComponent::from(reason)))
self.try_send_packet(&CPlayDisconnect::new(TextComponent::text(reason)))
.unwrap_or_else(|_| self.close());
}
_ => {