Skip to content

Unnecessary repeating of struct field names #7

@yousefmoazzam

Description

@yousefmoazzam

In the following section of code in the parsing into assembly AST nodes, there are some structs being initialised where the binding names match the field names in the struct (for which the compiler can make do with just the field names), but the binding name is still provided, which is redundant:

ir::Instruction::Return(val) => {
let src = parse_operand(val);
let dst = Operand::Register(Reg::AX);
vec![Instruction::Mov { src: src, dst: dst }, Instruction::Ret]
}
ir::Instruction::Unary { op, src, dst } => {
let op = parse_unary_operator(op);
let src = parse_operand(src);
let dst = parse_operand(dst);
vec![
Instruction::Mov {
src: src,
dst: dst.clone(),
},
Instruction::Unary { op: op, dst: dst },
]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions