aboutsummaryrefslogtreecommitdiff
path: root/src/serialize.rs
diff options
context:
space:
mode:
authorJoey Sacchini <joey@sacchini.net>2020-09-29 18:01:10 -0400
committerJoey Sacchini <joey@sacchini.net>2020-09-29 18:01:10 -0400
commit96e21585062b25f2be1707b0a599876aca4beaf2 (patch)
treedeff027b7ca4bfc6df5d9cf93965a11894e4f04d /src/serialize.rs
parentea719f78b2f38739cb27738d6050e304530c9884 (diff)
downloadmcproto-rs-96e21585062b25f2be1707b0a599876aca4beaf2.tar.gz
mcproto-rs-96e21585062b25f2be1707b0a599876aca4beaf2.tar.bz2
mcproto-rs-96e21585062b25f2be1707b0a599876aca4beaf2.zip
cargo fmt
Diffstat (limited to 'src/serialize.rs')
-rw-r--r--src/serialize.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/serialize.rs b/src/serialize.rs
index 5eb8f2a..3239b66 100644
--- a/src/serialize.rs
+++ b/src/serialize.rs
@@ -1,7 +1,7 @@
#[derive(Debug)]
pub enum SerializeErr {
FailedJsonEncode(String),
- InconsistentPlayerActions(String)
+ InconsistentPlayerActions(String),
}
pub type SerializeResult = Result<(), SerializeErr>;
@@ -11,14 +11,13 @@ pub trait Serialize: Sized {
}
pub trait Serializer: Sized {
-
fn serialize_bytes(&mut self, data: &[u8]) -> SerializeResult;
fn serialize_byte(&mut self, byte: u8) -> SerializeResult {
- self.serialize_bytes(vec!(byte).as_slice())
+ self.serialize_bytes(vec![byte].as_slice())
}
fn serialize_other<S: Serialize>(&mut self, other: &S) -> SerializeResult {
other.mc_serialize(self)
}
-} \ No newline at end of file
+}