Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fmt;
- enum Cbw {
- Cbw20,
- Cbw40,
- Cbw40Below,
- Cbw80,
- Cbw160,
- Cbw80PB0 { secondary80: usize },
- }
- impl fmt::Display for Cbw {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- let owned_suffix;
- let suffix = match self {
- Cbw::Cbw20 => "",
- Cbw::Cbw40 => "+",
- Cbw::Cbw40Below => "-",
- Cbw::Cbw80 => "V",
- Cbw::Cbw160 => "W",
- Cbw::Cbw80PB0 { secondary80 } => {
- owned_suffix = format!("{:?}", secondary80);
- &owned_suffix
- }
- };
- write!(f, "{}", suffix)
- }
- }
- fn main() {
- }
Add Comment
Please, Sign In to add comment