Skip to content

Commit 984870f

Browse files
committed
style: cargo fmt + clippy --fix to satisfy rust-ci (fmt --check + clippy -D warnings)
1 parent 4e36b04 commit 984870f

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

benches/typedqliser_bench.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! - `schema_check` and `type_check` overhead per query size.
99
//! - Plugin creation cost.
1010
11-
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
11+
use criterion::{BenchmarkId, Criterion, Throughput, black_box, criterion_group, criterion_main};
1212
use typedqliser::plugins::{ColumnDef, Schema, TableDef, get_plugin};
1313

1414
// ---------------------------------------------------------------------------
@@ -19,17 +19,15 @@ use typedqliser::plugins::{ColumnDef, Schema, TableDef, get_plugin};
1919
const SMALL_QUERY: &str = "SELECT id FROM accounts WHERE id = 1";
2020

2121
/// Medium query (~180 bytes) — a two-table JOIN with a WHERE clause.
22-
const MEDIUM_QUERY: &str =
23-
"SELECT accounts.id, accounts.username, transactions.amount \
22+
const MEDIUM_QUERY: &str = "SELECT accounts.id, accounts.username, transactions.amount \
2423
FROM accounts \
2524
INNER JOIN transactions ON accounts.id = transactions.account_id \
2625
WHERE accounts.id > 10 AND transactions.amount > 0 \
2726
ORDER BY transactions.amount DESC \
2827
LIMIT 50";
2928

3029
/// Large query (~400 bytes) — a CTE + subquery + GROUP BY.
31-
const LARGE_QUERY: &str =
32-
"WITH high_value AS ( \
30+
const LARGE_QUERY: &str = "WITH high_value AS ( \
3331
SELECT account_id, SUM(amount) AS total \
3432
FROM transactions \
3533
WHERE amount > 100 \

tests/e2e_test.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,7 @@ fn e2e_unknown_table_fails_at_l2() {
137137

138138
assert!(plugin.parse_check(query).is_ok(), "L1 must pass");
139139
let l2 = plugin.schema_check(query, &s).unwrap();
140-
assert!(
141-
!l2.is_empty(),
142-
"E2E: unknown table must produce L2 issues"
143-
);
140+
assert!(!l2.is_empty(), "E2E: unknown table must produce L2 issues");
144141
assert!(
145142
l2.iter().any(|i| i.message.contains("ghost_table")),
146143
"L2 issue must mention the missing table name"
@@ -307,7 +304,10 @@ fn e2e_cte_parses_at_l1() {
307304
let plugin = get_plugin("sql").unwrap();
308305
let query = "WITH top_accounts AS (SELECT id FROM accounts WHERE balance > 100) \
309306
SELECT id FROM top_accounts";
310-
assert!(plugin.parse_check(query).is_ok(), "E2E: CTE must parse at L1");
307+
assert!(
308+
plugin.parse_check(query).is_ok(),
309+
"E2E: CTE must parse at L1"
310+
);
311311
}
312312

313313
// ---------------------------------------------------------------------------

tests/property_test.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ const CORPUS: &[(&str, &str)] = &[
2222
// 0 — simple valid select
2323
("simple_select", "SELECT 1"),
2424
// 1 — select from known table (requires schema)
25-
("select_known", "SELECT id, username FROM accounts WHERE id = 1"),
25+
(
26+
"select_known",
27+
"SELECT id, username FROM accounts WHERE id = 1",
28+
),
2629
// 2 — invalid syntax
2730
("invalid_syntax", "NOT SQL AT ALL @@@ !!!"),
2831
// 3 — type mismatch: integer vs string
@@ -45,7 +48,10 @@ const CORPUS: &[(&str, &str)] = &[
4548
"SELECT id FROM accounts WHERE id IN (SELECT account_id FROM transactions)",
4649
),
4750
// 9 — aggregate
48-
("aggregate", "SELECT account_id, COUNT(*) FROM transactions GROUP BY account_id"),
51+
(
52+
"aggregate",
53+
"SELECT account_id, COUNT(*) FROM transactions GROUP BY account_id",
54+
),
4955
];
5056

5157
// ---------------------------------------------------------------------------
@@ -333,7 +339,7 @@ fn property_no_panic_on_full_corpus() {
333339
// We cannot move plugin/s into catch_unwind easily, so we just
334340
// verify the calls succeed outside of catch_unwind — if they
335341
// panic, the test fails.
336-
drop(label);
342+
let _ = label;
337343
});
338344
let _ = plugin.schema_check(query, &s);
339345
let _ = plugin.type_check(query, &s);

0 commit comments

Comments
 (0)