Fixed MaterialIcon display.
This commit is contained in:
parent
8a7d1dbae4
commit
207f525310
|
@ -79,15 +79,14 @@ impl_from_and_into_var! {
|
||||||
}
|
}
|
||||||
impl fmt::Display for MaterialIcon {
|
impl fmt::Display for MaterialIcon {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
let mut chars = self.name.chars();
|
let mut chars = self.name.chars().peekable();
|
||||||
if let Some(n) = chars.next() {
|
if let Some(n) = chars.next() {
|
||||||
// skip N if followed by number.
|
// skip N if followed by number.
|
||||||
if n == 'N' {
|
if n == 'N' {
|
||||||
if let Some(q) = chars.next() {
|
if let Some(q) = chars.peek() {
|
||||||
if !q.is_ascii_digit() {
|
if !q.is_ascii_digit() {
|
||||||
write!(f, "{n}")?;
|
write!(f, "{n}")?;
|
||||||
}
|
}
|
||||||
write!(f, "{q}")?;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
write!(f, "{n}")?;
|
write!(f, "{n}")?;
|
||||||
|
|
Loading…
Reference in New Issue