removed underscore from field and method traits because rust doesnt like it
This commit is contained in:
parent
903d05911a
commit
efcc14fc1c
|
@ -245,7 +245,7 @@ pub fn generate_class_impl<W: Write>(class: &Class, sdk: &Sdk, w: &mut W) -> any
|
||||||
|
|
||||||
let name = class.rust_name();
|
let name = class.rust_name();
|
||||||
|
|
||||||
writeln!(w, "pub trait {}_Fields: AsPtr {{", name)?;
|
writeln!(w, "pub trait {}Fields: AsPtr {{", name)?;
|
||||||
for field in fields {
|
for field in fields {
|
||||||
write!(w, "fn get_{}(&self) -> &", field.name)?;
|
write!(w, "fn get_{}(&self) -> &", field.name)?;
|
||||||
field.ty.rust_type(sdk, w)?;
|
field.ty.rust_type(sdk, w)?;
|
||||||
|
@ -273,19 +273,19 @@ pub fn generate_class_impl<W: Write>(class: &Class, sdk: &Sdk, w: &mut W) -> any
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
writeln!(w, "}}")?;
|
writeln!(w, "}}")?;
|
||||||
writeln!(w, "impl {name}_Fields for {name} {{}}")?;
|
writeln!(w, "impl {name}Fields for {name} {{}}")?;
|
||||||
|
|
||||||
for method in methods {
|
for method in methods {
|
||||||
generate_method_params(class, method, sdk, w)?;
|
generate_method_params(class, method, sdk, w)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeln!(w, "pub trait {}_Methods: AsPtr {{", name)?;
|
writeln!(w, "pub trait {}Methods: AsPtr {{", name)?;
|
||||||
|
|
||||||
for method in methods {
|
for method in methods {
|
||||||
generate_method(class, method, sdk, w)?;
|
generate_method(class, method, sdk, w)?;
|
||||||
}
|
}
|
||||||
writeln!(w, "}}")?;
|
writeln!(w, "}}")?;
|
||||||
writeln!(w, "impl {name}_Methods for {name} {{}}")?;
|
writeln!(w, "impl {name}Methods for {name} {{}}")?;
|
||||||
|
|
||||||
if let Some(supr) = super_class {
|
if let Some(supr) = super_class {
|
||||||
let iter = core::iter::once(*supr).chain(supr.iter_super_structs());
|
let iter = core::iter::once(*supr).chain(supr.iter_super_structs());
|
||||||
|
@ -293,8 +293,8 @@ pub fn generate_class_impl<W: Write>(class: &Class, sdk: &Sdk, w: &mut W) -> any
|
||||||
if let Some(parent) = sdk.find_type(parent.as_uobject()) {
|
if let Some(parent) = sdk.find_type(parent.as_uobject()) {
|
||||||
match parent {
|
match parent {
|
||||||
Types::Class(class) => {
|
Types::Class(class) => {
|
||||||
writeln!(w, "impl {}_Methods for {name} {{}}", class.rust_name())?;
|
writeln!(w, "impl {}Methods for {name} {{}}", class.rust_name())?;
|
||||||
writeln!(w, "impl {}_Fields for {name} {{}}", class.rust_name())?;
|
writeln!(w, "impl {}Fields for {name} {{}}", class.rust_name())?;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue