```rust impl BinOp { pub fn to_str(&self) -> &str { match self { BinOp::Add
can somebody explain to me why rust code is filled with these match statements
impl BinOp {
pub fn to_str(&self) -> &str {
match self {
BinOp::Add => "+",
BinOp::Sub => "-",
BinOp::Mul => "*",
BinOp::Div => "/",
BinOp::Mod => "%",
BinOp::And => "&&",
BinOp::Or => "||",
BinOp::Eq => "==",
BinOp::BangEq => "!=",
BinOp::Less => "<",
BinOp::LessEq => "<=",
BinOp::Greater => ">",
BinOp::GreaterEq => ">=",
}
}
}map Const::A => A over and overA => A is common in any language, I have only seen it in rust

map Const::A => AA => AtoStr :: Op -> String
toStr OpPlus = "+"
toStr OpMinus = "-"
...