🐛 Remove children correctly

This commit is contained in:
Elena Torro 2025-04-09 12:19:47 +02:00
parent 82cf474863
commit 953db56a0d
4 changed files with 13 additions and 14 deletions

View file

@ -56,6 +56,12 @@ pub fn bytes() -> Vec<u8> {
.map_or_else(|| panic!("Buffer is not initialized"), |buffer| *buffer)
}
pub fn bytes_or_empty() -> Vec<u8> {
let mut guard = BUFFERU8.lock().unwrap();
guard.take().map_or_else(|| Vec::new(), |buffer| *buffer)
}
pub trait SerializableResult {
type BytesType;
fn from_bytes(bytes: Self::BytesType) -> Self;