mod.rs - icy_draw - icy_draw is the successor to mystic draw. fork / mirror
 (HTM) git clone https://git.drkhsh.at/icy_draw.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       mod.rs (930B)
       ---
            1 mod ansi;
            2 use std::error::Error;
            3 
            4 pub use ansi::*;
            5 
            6 mod bitfont;
            7 pub use bitfont::*;
            8 
            9 mod charfont;
           10 pub use charfont::*;
           11 
           12 mod animation;
           13 pub use animation::*;
           14 
           15 #[derive(Debug, Clone)]
           16 pub enum SavingError {
           17     ErrorWritingFile(String),
           18     ErrorCreatingFile(String),
           19 }
           20 
           21 impl std::fmt::Display for SavingError {
           22     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
           23         match self {
           24             SavingError::ErrorWritingFile(error) => {
           25                 write!(f, "Error writing file: {}", error)
           26             }
           27             SavingError::ErrorCreatingFile(error) => {
           28                 write!(f, "Error creating file: {}", error)
           29             }
           30         }
           31     }
           32 }
           33 impl Error for SavingError {
           34     fn description(&self) -> &str {
           35         "use std::display"
           36     }
           37 
           38     fn source(&self) -> Option<&(dyn Error + 'static)> {
           39         None
           40     }
           41 
           42     fn cause(&self) -> Option<&dyn Error> {
           43         self.source()
           44     }
           45 }