Add newlines in generated cdef for readability

This commit is contained in:
2025-06-26 13:06:39 +10:00
parent f456a544e1
commit 2fe9515702

View File

@@ -345,12 +345,12 @@ impl<'r> MetatypeBuilder<'r> {
) -> &mut Self { ) -> &mut Self {
write!(self.lua, "__idx.{name} = ").unwrap(); write!(self.lua, "__idx.{name} = ").unwrap();
f(&mut MetatypeMethodBuilder::new(self)); f(&mut MetatypeMethodBuilder::new(self));
write!(self.lua, "; ").unwrap(); writeln!(self.lua, ";").unwrap();
self self
} }
pub fn index_raw(&mut self, name: impl Display, value: impl Display) -> &mut Self { pub fn index_raw(&mut self, name: impl Display, value: impl Display) -> &mut Self {
write!(self.lua, "__idx.{name} = {value}; ").unwrap(); writeln!(self.lua, "__idx.{name} = {value};").unwrap();
self self
} }
@@ -361,12 +361,12 @@ impl<'r> MetatypeBuilder<'r> {
) -> &mut Self { ) -> &mut Self {
write!(self.lua, "__mt.__{name} = ").unwrap(); write!(self.lua, "__mt.__{name} = ").unwrap();
f(&mut MetatypeMethodBuilder::new(self)); f(&mut MetatypeMethodBuilder::new(self));
write!(self.lua, "; ").unwrap(); writeln!(self.lua, ";").unwrap();
self self
} }
pub fn metatable_raw(&mut self, name: impl Display, value: impl Display) -> &mut Self { pub fn metatable_raw(&mut self, name: impl Display, value: impl Display) -> &mut Self {
write!(self.lua, "__mt.__{name} = {value}; ").unwrap(); writeln!(self.lua, "__mt.__{name} = {value};").unwrap();
self self
} }
} }