Skip to content

Commit

Permalink
Format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
egli committed Jan 23, 2024
1 parent 1ffa1a4 commit a98a009
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum Commands {
/// String to translate. If no input is specified, a REPL is
/// opened and each line you enter is translated.
input: Option<String>,
/// Direction of translation
/// Direction of translation
#[arg(value_enum, short, long, default_value_t=Direction::Forward)]
direction: Direction,
},
Expand Down
2 changes: 1 addition & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<'a> TestMatrix<'a> {
TestMatrix {
display,
tables,
directions,
directions,
tests,
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use libyaml::{Encoding, Event, Parser, ParserIter};
use crate::parser::Direction;
use crate::test::{
CursorPosition, Directions, Display, ExpectedFailure, Table, TableQuery, Test, TestError,
TestMode, TestResult, TestMatrix, TranslationMode, Typeform,
TestMatrix, TestMode, TestResult, TranslationMode, Typeform,
};

type YAMLEventError = Option<Result<Event, libyaml::ParserError>>;
Expand Down Expand Up @@ -146,7 +146,7 @@ impl<'a> YAMLParser<'a> {
}
Some(Ok(Event::SequenceStart { .. })) => Table::List(self.table_list()?),
Some(Ok(Event::Scalar { .. })) => {
let value = self.scalar()?;
let value = self.scalar()?;
// if the scalar contains newlines we assume it is an inline table
if value.contains('\n') {
Table::Inline(value)
Expand Down Expand Up @@ -445,8 +445,12 @@ impl<'a> YAMLParser<'a> {
}
"tests" => {
let tests = self.tests()?;
let suite =
TestMatrix::new(&current_display_table, &current_tables, &test_mode, &tests);
let suite = TestMatrix::new(
&current_display_table,
&current_tables,
&test_mode,
&tests,
);
results.extend(suite.check()?);
current_tables.clear();
}
Expand Down

0 comments on commit a98a009

Please sign in to comment.