diff options
| author | mat <github@matdoes.dev> | 2023-03-11 16:38:13 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2023-03-11 16:38:13 -0600 |
| commit | 40a0c8acfbfb88be791c295a14014468e2fd4298 (patch) | |
| tree | 54019c0f68d4bdfa944c4b2e80249dae858f302c /azalea-nbt/README.md | |
| parent | 81e7adb409199ac6594a18ca1bd88bfe89fbfc3e (diff) | |
| download | azalea-drasl-40a0c8acfbfb88be791c295a14014468e2fd4298.tar.xz | |
slightly optimize azalea_nbt::Tag::id
Diffstat (limited to 'azalea-nbt/README.md')
| -rwxr-xr-x | azalea-nbt/README.md | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/azalea-nbt/README.md b/azalea-nbt/README.md index 5204c2d4..27de2fa6 100755 --- a/azalea-nbt/README.md +++ b/azalea-nbt/README.md @@ -7,11 +7,9 @@ A fast NBT serializer and deserializer. ``` use ahash::AHashMap; use azalea_nbt::Tag; -use std::{io::{Cursor, Read}, fs::File}; +use std::io::Cursor; -let mut file = File::open("tests/hello_world.nbt").unwrap(); -let mut buf = vec![]; -file.read_to_end(&mut buf).unwrap(); +let buf = include_bytes!("../tests/hello_world.nbt"); let tag = Tag::read(&mut Cursor::new(&buf[..])).unwrap(); assert_eq!( tag, |
