Removed void
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user