Skip to content

Commit 6f6aef4

Browse files
committed
Cargo fmt.
Signed-off-by: Bruce Ritchie <[email protected]>
1 parent ae5d26b commit 6f6aef4

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

sqllogictest-bin/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ use itertools::Itertools;
1616
use quick_junit::{NonSuccessKind, Report, TestCase, TestCaseStatus, TestSuite};
1717
use rand::distributions::DistString;
1818
use rand::seq::SliceRandom;
19-
use sqllogictest::{default_column_validator, default_normalizer, default_validator, update_record_with_output, AsyncDB, Injected, MakeConnection, Record, Runner};
19+
use sqllogictest::{
20+
default_column_validator, default_normalizer, default_validator, update_record_with_output,
21+
AsyncDB, Injected, MakeConnection, Record, Runner,
22+
};
2023

2124
#[derive(Default, Copy, Clone, Debug, PartialEq, Eq, ValueEnum)]
2225
#[must_use]

sqllogictest/src/parser.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,10 @@ fn parse_inner<T: ColumnType>(loc: &Location, script: &str) -> Result<Vec<Record
850850
});
851851
}
852852
["control", res @ ..] => match res {
853-
["resultmode", result_mode] => match ResultMode::try_from_str(result_mode) {
854-
Ok(result_mode) => records.push(Record::Control(Control::ResultMode(result_mode))),
853+
["resultmode", result_mode] => match ResultMode::try_from_str(result_mode) {
854+
Ok(result_mode) => {
855+
records.push(Record::Control(Control::ResultMode(result_mode)))
856+
}
855857
Err(k) => return Err(k.at(loc)),
856858
},
857859
["sortmode", sort_mode] => match SortMode::try_from_str(sort_mode) {
@@ -871,7 +873,7 @@ fn parse_inner<T: ColumnType>(loc: &Location, script: &str) -> Result<Vec<Record
871873
ParseErrorKind::InvalidNumber((*threshold).into()).at(loc.clone())
872874
})?,
873875
});
874-
},
876+
}
875877
_ => return Err(ParseErrorKind::InvalidLine(line.into()).at(loc)),
876878
}
877879
}

sqllogictest/src/runner.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,14 @@ pub fn default_normalizer(s: &String) -> String {
467467
/// # Default
468468
///
469469
/// By default, the ([`default_validator`]) will be used compare normalized results.
470-
pub type Validator = fn(normalizer: Normalizer, actual: &[Vec<String>], expected: &[String]) -> bool;
470+
pub type Validator =
471+
fn(normalizer: Normalizer, actual: &[Vec<String>], expected: &[String]) -> bool;
471472

472-
pub fn default_validator(normalizer: Normalizer, actual: &[Vec<String>], expected: &[String]) -> bool {
473+
pub fn default_validator(
474+
normalizer: Normalizer,
475+
actual: &[Vec<String>],
476+
expected: &[String],
477+
) -> bool {
473478
let expected_results = expected.iter().map(normalizer).collect_vec();
474479
// Default, we compare normalized results. Whitespace characters are ignored.
475480
let normalized_rows = actual
@@ -1032,11 +1037,11 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
10321037
}
10331038

10341039
let actual_results = match self.result_mode {
1035-
Some(ResultMode::ValueWise) =>
1036-
rows.into_iter()
1037-
.flat_map(|strs| strs.into_iter())
1038-
.map(|str| vec![str.to_string()])
1039-
.collect_vec(),
1040+
Some(ResultMode::ValueWise) => rows
1041+
.into_iter()
1042+
.flat_map(|strs| strs.into_iter())
1043+
.map(|str| vec![str.to_string()])
1044+
.collect_vec(),
10401045
// default to rowwise
10411046
_ => rows.clone(),
10421047
};
@@ -1591,7 +1596,10 @@ pub fn update_record_with_output<T: ColumnType>(
15911596
connection,
15921597
expected: match expected {
15931598
QueryExpect::Results {
1594-
sort_mode, label, result_mode, ..
1599+
sort_mode,
1600+
label,
1601+
result_mode,
1602+
..
15951603
} => QueryExpect::Results {
15961604
results,
15971605
types,

0 commit comments

Comments
 (0)