Add newlines in generated cdef for readability

This commit is contained in:
lumi 2025-06-26 13:06:39 +10:00
parent f456a544e1
commit 2fe9515702
Signed by: luaneko
GPG Key ID: 406809B8763FF07A

View File

@ -345,12 +345,12 @@ impl<'r> MetatypeBuilder<'r> {
) -> &mut Self {
write!(self.lua, "__idx.{name} = ").unwrap();
f(&mut MetatypeMethodBuilder::new(self));
write!(self.lua, "; ").unwrap();
writeln!(self.lua, ";").unwrap();
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
}
@ -361,12 +361,12 @@ impl<'r> MetatypeBuilder<'r> {
) -> &mut Self {
write!(self.lua, "__mt.__{name} = ").unwrap();
f(&mut MetatypeMethodBuilder::new(self));
write!(self.lua, "; ").unwrap();
writeln!(self.lua, ";").unwrap();
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
}
}