diff options
| author | mat <github@matdoes.dev> | 2022-04-22 20:49:42 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-22 20:49:42 -0500 |
| commit | 3057ae8b4ad616258f9f4fd777d85fb20a6eef9c (patch) | |
| tree | 2ae941ec85ece15630bdd3790fa7743689c2357a /azalea-nbt/src/encode.rs | |
| parent | b03d3da65937aebcba1cb38573d02267e49bfe19 (diff) | |
| download | azalea-drasl-3057ae8b4ad616258f9f4fd777d85fb20a6eef9c.tar.xz | |
maybe optimization
Diffstat (limited to 'azalea-nbt/src/encode.rs')
| -rwxr-xr-x | azalea-nbt/src/encode.rs | 5 |
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() |
