Cargo fmt + added *.local.nbt to .gitignore

This commit is contained in:
lukas0008 2024-08-21 18:06:57 +02:00
parent 0d05e5ef36
commit c02200c7fd
2 changed files with 7 additions and 2 deletions

3
.gitignore vendored
View File

@ -86,3 +86,6 @@ world/
# project's binary configurations # project's binary configurations
configuration.toml configuration.toml
features.toml features.toml
*.local.nbt

View File

@ -168,7 +168,9 @@ impl ByteBuffer {
/// some, then it also calls the `write` closure. /// some, then it also calls the `write` closure.
pub fn put_option<T>(&mut self, val: &Option<T>, write: impl FnOnce(&mut Self, &T)) { pub fn put_option<T>(&mut self, val: &Option<T>, write: impl FnOnce(&mut Self, &T)) {
self.put_bool(val.is_some()); self.put_bool(val.is_some());
if let Some(v) = val { write(self, v) } if let Some(v) = val {
write(self, v)
}
} }
pub fn get_list<T>(&mut self, val: impl Fn(&mut Self) -> T) -> Vec<T> { pub fn get_list<T>(&mut self, val: impl Fn(&mut Self) -> T) -> Vec<T> {