October 2019
Intermediate to advanced
444 pages
10h 37m
English
Follow these steps to explore enums:
use std::io;pub enum ApplicationError { Code { full: usize, short: u16 }, Message(String), IOWrapper(io::Error), Unknown}
impl ApplicationError { pub fn print_kind(&self, mut to: &mut impl io::Write) -> io::Result<()> { let kind = match self { ApplicationError::Code { full: _, short: _ } => "Code", ApplicationError::Unknown => "Unknown", ApplicationError::IOWrapper(_) => "IOWrapper", ApplicationError::Message(_) => "Message" }; write!(&mut ...Read now
Unlock full access