From a98a0096601289798ade5ee82cf76f1cdd8c8eef Mon Sep 17 00:00:00 2001 From: Christian Egli Date: Tue, 23 Jan 2024 10:31:07 +0100 Subject: [PATCH] Format the code --- src/main.rs | 2 +- src/test.rs | 2 +- src/yaml.rs | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index e43e753..4a8c2e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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, - /// Direction of translation + /// Direction of translation #[arg(value_enum, short, long, default_value_t=Direction::Forward)] direction: Direction, }, diff --git a/src/test.rs b/src/test.rs index 4532905..d944e4f 100644 --- a/src/test.rs +++ b/src/test.rs @@ -87,7 +87,7 @@ impl<'a> TestMatrix<'a> { TestMatrix { display, tables, - directions, + directions, tests, } } diff --git a/src/yaml.rs b/src/yaml.rs index 7382cab..8a627e1 100644 --- a/src/yaml.rs +++ b/src/yaml.rs @@ -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>; @@ -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) @@ -445,8 +445,12 @@ impl<'a> YAMLParser<'a> { } "tests" => { let tests = self.tests()?; - let suite = - TestMatrix::new(¤t_display_table, ¤t_tables, &test_mode, &tests); + let suite = TestMatrix::new( + ¤t_display_table, + ¤t_tables, + &test_mode, + &tests, + ); results.extend(suite.check()?); current_tables.clear(); }