Removed void

This commit is contained in:
2026-06-07 03:40:23 +02:00
parent 206b2fa414
commit 9001c1c3e2
+2 -12
View File
@@ -184,9 +184,9 @@ impl GetRust for TypeExpr {
match self { match self {
Self::Path(path, generics) => { Self::Path(path, generics) => {
if let Some(generics) = generics { if let Some(generics) = generics {
format!("{}{}", get_static_type_path(path), generics.get_rust()) format!("{}{}", path.get_rust(), generics.get_rust())
} else { } else {
get_static_type_path(path) path.get_rust()
} }
} }
Self::Lifetime(name) => format!("'{}", name.get_rust()), Self::Lifetime(name) => format!("'{}", name.get_rust()),
@@ -247,16 +247,6 @@ impl GetRust for TypeExpr {
} }
} }
pub fn get_static_type_path(path: &Path) -> String {
let rust_path = path.get_rust();
if rust_path == "void" {
format!("()")
} else {
rust_path
}
}
impl GenRust for Pattern { impl GenRust for Pattern {
fn gen_rust(&self, ctx: &mut Context, cg: &mut RustCodegen) { fn gen_rust(&self, ctx: &mut Context, cg: &mut RustCodegen) {
match self { match self {