diff options
| author | mat <git@matdoes.dev> | 2025-02-23 03:10:21 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-23 03:10:21 +0000 |
| commit | f8130c3c92946d2293634ba4e252d6bc93026c3c (patch) | |
| tree | 08fc6097137d7b4d31b692f4ba993b23acc64eb7 /azalea-buf/src/write.rs | |
| parent | 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (diff) | |
| download | azalea-drasl-f8130c3c92946d2293634ba4e252d6bc93026c3c.tar.xz | |
minor memory usage optimizations
Diffstat (limited to 'azalea-buf/src/write.rs')
| -rwxr-xr-x | azalea-buf/src/write.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/azalea-buf/src/write.rs b/azalea-buf/src/write.rs index c4b9f413..73aefe40 100755 --- a/azalea-buf/src/write.rs +++ b/azalea-buf/src/write.rs @@ -1,6 +1,7 @@ use std::{ collections::HashMap, io::{self, Write}, + sync::Arc, }; use byteorder::{BigEndian, WriteBytesExt}; @@ -298,3 +299,9 @@ impl<A: AzaleaWrite, B: AzaleaWrite> AzaleaWrite for (A, B) { self.1.azalea_write(buf) } } + +impl<T: AzaleaWrite> AzaleaWrite for Arc<T> { + fn azalea_write(&self, buf: &mut impl Write) -> Result<(), io::Error> { + T::azalea_write(&**self, buf) + } +} |
