Skip to content

Commit

Permalink
Format the source code
Browse files Browse the repository at this point in the history
  • Loading branch information
egli committed May 23, 2024
1 parent 185a797 commit b1a5ab1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ pub enum TranslationError {
#[error("Implicit character {0:?} not defined")]
ImplicitCharacterNotDefined(char),
#[error("Character in base rule not defined: derived: {derived:?}, base: {base:?}, direction: {direction:?}")]
BaseCharacterNotDefined{base: char, derived: char, direction: Direction},
BaseCharacterNotDefined {
base: char,
derived: char,
direction: Direction,
},
}

#[derive(Debug, PartialEq, Clone)]
Expand Down Expand Up @@ -242,7 +246,13 @@ impl TranslationTable {
for rule in rules {
match rule.rule {
Rule::Base { derived, base, .. } => {
let translation = character_definitions.get(&base).ok_or(TranslationError::BaseCharacterNotDefined{base, derived, direction})?;
let translation = character_definitions.get(&base).ok_or(
TranslationError::BaseCharacterNotDefined {
base,
derived,
direction,
},
)?;
character_definitions.insert(
derived,
Translation {
Expand Down

0 comments on commit b1a5ab1

Please sign in to comment.