Implement a working %include macro

This commit is contained in:
2024-06-08 19:50:57 -07:00
parent 0ac9ee4a3f
commit c1af3290d5
4 changed files with 37 additions and 22 deletions
-5
View File
@@ -394,7 +394,6 @@ fn board_slice(bytes: &[u8]) -> IResult<&[u8], &[u8], LoadError> {
trait SerializationHelpers {
fn push_bool(&mut self, value: bool);
fn push_i16(&mut self, value: i16);
fn push_u16(&mut self, value: u16);
fn push_string(&mut self, cap: u8, value: &[u8]) -> Result<(), &'static str>;
fn push_padding(&mut self, size: usize);
}
@@ -408,10 +407,6 @@ impl SerializationHelpers for Vec<u8> {
self.extend(value.to_le_bytes());
}
fn push_u16(&mut self, value: u16) {
self.extend(value.to_le_bytes());
}
fn push_string(&mut self, cap: u8, value: &[u8]) -> Result<(), &'static str> {
if value.len() > cap as usize {
return Err("string too long");