aboutsummaryrefslogtreecommitdiff
path: root/azalea-nbt/src/lib.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-23 15:28:33 -0500
committermat <github@matdoes.dev>2022-06-23 15:28:33 -0500
commitba399c4440c2d182f55cba7fab068e1118bcc2b7 (patch)
tree20188f93e3fe16b747350ef2b44678b188313c61 /azalea-nbt/src/lib.rs
parent5ca49e680ed8519456dc9a9af84321d4b69dcbb3 (diff)
downloadazalea-drasl-ba399c4440c2d182f55cba7fab068e1118bcc2b7.tar.xz
switch things to use azalea-buf
Diffstat (limited to 'azalea-nbt/src/lib.rs')
-rwxr-xr-xazalea-nbt/src/lib.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/azalea-nbt/src/lib.rs b/azalea-nbt/src/lib.rs
index 8cca1f2b..cb2eb28e 100755
--- a/azalea-nbt/src/lib.rs
+++ b/azalea-nbt/src/lib.rs
@@ -9,23 +9,24 @@ pub use tag::Tag;
#[cfg(test)]
mod tests {
use super::*;
+ use azalea_buf::{McBufReadable, McBufWritable};
use std::{collections::HashMap, io::Cursor};
#[test]
fn mcbuf_nbt() {
let mut buf = Vec::new();
- buf.write_nbt(&Tag::Compound(HashMap::from_iter(vec![(
+ let tag = Tag::Compound(HashMap::from_iter(vec![(
"hello world".to_string(),
Tag::Compound(HashMap::from_iter(vec![(
"name".to_string(),
Tag::String("Bananrama".to_string()),
)])),
- )])))
- .unwrap();
+ )]));
+ tag.write_into(&mut buf).unwrap();
let mut buf = Cursor::new(buf);
- let result = buf.read_nbt().unwrap();
+ let result = Tag::read_into(&mut buf).unwrap();
assert_eq!(
result,
Tag::Compound(HashMap::from_iter(vec![(