Removed new keyword
This commit is contained in:
@@ -87,7 +87,6 @@ impl GenRust for Expression {
|
||||
} => {
|
||||
prefixes.gen_rust(ctx, cg);
|
||||
initial.gen_rust(ctx, cg);
|
||||
cg.add(&Some(prefixes).get_rust());
|
||||
for postfix in postfixes {
|
||||
postfix.gen_rust(ctx, cg);
|
||||
}
|
||||
@@ -117,7 +116,6 @@ impl GenRust for Prefix {
|
||||
Self::Ref => cg.add("&"),
|
||||
Self::RefMut => cg.add("&mut "),
|
||||
Self::Not => cg.add("!"),
|
||||
Self::New(_) => cg.add(""),
|
||||
Self::Neg => cg.add("-"),
|
||||
Self::Closure(ty, args) => {
|
||||
cg.add("|");
|
||||
@@ -148,30 +146,6 @@ impl GenRust for Vec<Prefix> {
|
||||
}
|
||||
}
|
||||
|
||||
impl GetRust for Option<&Vec<Prefix>> {
|
||||
fn get_rust(&self) -> String {
|
||||
if let Some(prefixes) = self {
|
||||
prefixes
|
||||
.into_iter()
|
||||
.last()
|
||||
.map(|p| match p {
|
||||
Prefix::New(generics) => format!(
|
||||
"::new{}",
|
||||
generics
|
||||
.clone()
|
||||
.map(|v| format!("::{}", v.get_rust()))
|
||||
.unwrap_or_default(),
|
||||
),
|
||||
_ => String::new(),
|
||||
})
|
||||
.unwrap_or_default()
|
||||
.to_string()
|
||||
} else {
|
||||
String::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GenRust for Postfix {
|
||||
fn gen_rust(&self, ctx: &mut Context, cg: &mut RustCodegen) {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user