aboutsummaryrefslogtreecommitdiff
path: root/azalea-nbt/src/encode.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-22 20:49:42 -0500
committermat <github@matdoes.dev>2022-04-22 20:49:42 -0500
commit3057ae8b4ad616258f9f4fd777d85fb20a6eef9c (patch)
tree2ae941ec85ece15630bdd3790fa7743689c2357a /azalea-nbt/src/encode.rs
parentb03d3da65937aebcba1cb38573d02267e49bfe19 (diff)
downloadazalea-drasl-3057ae8b4ad616258f9f4fd777d85fb20a6eef9c.tar.xz
maybe optimization
Diffstat (limited to 'azalea-nbt/src/encode.rs')
-rwxr-xr-xazalea-nbt/src/encode.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/azalea-nbt/src/encode.rs b/azalea-nbt/src/encode.rs
index ef72dce2..d1126ee0 100755
--- a/azalea-nbt/src/encode.rs
+++ b/azalea-nbt/src/encode.rs
@@ -54,6 +54,7 @@ impl Tag {
match first_tag {
Self::Int(_) => {
for i in value {
+ assert!(matches!(i, Tag::Int(_)));
writer.write_i32::<BE>(
*i.as_int().expect("List of Int should only contains Int"),
)?;
@@ -61,6 +62,7 @@ impl Tag {
}
Self::String(_) => {
for i in value {
+ assert!(matches!(i, Tag::String(_)));
write_string(
writer,
i.as_string()
@@ -68,8 +70,9 @@ impl Tag {
)?;
}
}
- &Self::Compound(_) => {
+ Self::Compound(_) => {
for i in value {
+ assert!(matches!(i, Tag::Compound(_)));
write_compound(
writer,
i.as_compound()