Skip to content

Commit

Permalink
#29 fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 7, 2022
1 parent d9fea02 commit 42a2e37
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/gmi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,18 @@ impl Gmi {
let head = s.chars().next().context(format!("Empty identifier"))?;
let tail: String = s.chars().skip(1).collect::<Vec<_>>().into_iter().collect();
if head == '$' {
Ok(
*self
.vars
.entry(tail.to_string())
.or_insert_with(||
match tail.chars().next().context(format!("Empty prefix")).unwrap() {
'ν' => uni.next_v(),
' => uni.next_e(),
p => panic!("Unknown prefix '{}' in {}", p, tail)
}
)
)
Ok(*self.vars.entry(tail.to_string()).or_insert_with(|| {
match tail
.chars()
.next()
.context(format!("Empty prefix"))
.unwrap()
{
' => uni.next_v(),
'ε' => uni.next_e(),
p => panic!("Unknown prefix '{}' in {}", p, tail),
}
}))
} else {
Ok(u32::from_str(tail.as_str()).context(format!("Parsing of '{}' failed", s))?)
}
Expand Down

0 comments on commit 42a2e37

Please sign in to comment.