Display for State enum
This commit is contained in:
		
							parent
							
								
									43054b3f49
								
							
						
					
					
						commit
						c84251b56f
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -7,6 +7,8 @@ mod char;
 | 
			
		|||
mod charset;
 | 
			
		||||
mod str;
 | 
			
		||||
 | 
			
		||||
use std::fmt;
 | 
			
		||||
 | 
			
		||||
use self::char::Lexable;
 | 
			
		||||
use self::str::CharAt;
 | 
			
		||||
use self::str::RelativeIndexable;
 | 
			
		||||
| 
						 | 
				
			
			@ -149,3 +151,15 @@ impl Iterator for Lexer {
 | 
			
		|||
        token
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl fmt::Display for State {
 | 
			
		||||
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 | 
			
		||||
        let s = match *self {
 | 
			
		||||
            State::Initial => "Initial",
 | 
			
		||||
            State::Identifier => "Identifier",
 | 
			
		||||
            State::Hash => "Hash",
 | 
			
		||||
        };
 | 
			
		||||
        write!(f, "{}", s)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue