As of Rust 1.21.0, you can use std::mem::discriminant : fn variant_eq(a: &Op, b: &Op) -> bool { std::mem::discriminant(a) ...
確定! 回上一頁