Use into_*(self) convention, fixes wrong_self_convention

This commit is contained in:
ice_iix 2020-07-02 17:51:48 -07:00
parent 5ce06c3067
commit 476d46cac6
2 changed files with 4 additions and 4 deletions

View File

@ -1028,9 +1028,9 @@ impl Server {
};
// TODO: refactor with write_plugin_message
if self.protocol_version >= 47 {
self.write_packet(brand.as_message());
self.write_packet(brand.into_message());
} else {
self.write_packet(brand.as_message17());
self.write_packet(brand.into_message17());
}
}

View File

@ -7,7 +7,7 @@ pub struct Brand {
}
impl Brand {
pub fn as_message(self) -> PluginMessageServerbound {
pub fn into_message(self) -> PluginMessageServerbound {
let protocol_version = crate::protocol::current_protocol_version();
let channel_name = if protocol_version >= 404 {
@ -25,7 +25,7 @@ impl Brand {
}
// TODO: cleanup this duplication for 1.7, return either message dynamically
pub fn as_message17(self) -> PluginMessageServerbound_i16 {
pub fn into_message17(self) -> PluginMessageServerbound_i16 {
let mut data = vec![];
Serializable::write_to(&self.brand, &mut data).unwrap();
PluginMessageServerbound_i16 {