Use Display for Degree in token::describe

This commit is contained in:
Colin Benner 2018-11-21 14:37:46 +01:00 committed by Tiffany Bennett
parent 0581d8f247
commit 232f35c108

View file

@ -64,13 +64,8 @@ fn describe(token: &Token) -> String {
Token::Colon => "`:`".to_owned(),
Token::Date(_) => "date literal".to_owned(),
Token::Comma => "`,`".to_owned(),
Token::Degree(Degree::Celsius) => "`°C`".to_owned(),
Token::Degree(Degree::Fahrenheit) => "`°F`".to_owned(),
Token::Degree(Degree::Reaumur) => "`°Ré`".to_owned(),
Token::Degree(Degree::Romer) => "`°Rø`".to_owned(),
Token::Degree(Degree::Delisle) => "`°De`".to_owned(),
Token::Degree(Degree::Newton) => "`°N`".to_owned(),
Token::Percent => "%".to_owned(),
Token::Degree(ref deg) => format!("`{}`", deg),
Token::Error(ref e) => format!("<{}>", e)
}
}