style: format the whole tree with cargo fmt (stock defaults, #35)

One-time, mechanical reformat — no functional changes. The tree was not
rustfmt-clean (~1800 hunks across ~100 files); this brings it to stock
`cargo fmt` defaults so a `cargo fmt --check` CI gate can follow.
Behaviour-preserving: 2509 pass / 0 fail / 1 ignored (unchanged baseline),
clippy clean. A .git-blame-ignore-revs entry follows so `git blame`
skips this commit.
This commit is contained in:
claude@clouddev1
2026-06-17 21:39:19 +00:00
parent e9606b5f6d
commit 41b7e9a049
102 changed files with 8017 additions and 4975 deletions
+47 -13
View File
@@ -24,8 +24,7 @@ fn rt() -> tokio::runtime::Runtime {
fn open() -> (project::Project, Database, tempfile::TempDir) {
let dir = tempfile::tempdir().expect("create tempdir");
let project =
project::open_or_create(None, Some(dir.path())).expect("open or create project");
let project = project::open_or_create(None, Some(dir.path())).expect("open or create project");
let db = Database::open_with_persistence(
project.db_path(),
Persistence::new(project.path().to_path_buf()),
@@ -78,7 +77,10 @@ fn rename_column_with_case_variant_table_keeps_metadata_in_step() {
let r = rt();
r.block_on(db.create_table(
"Items".to_string(),
vec![ColumnSpec::new("id", Type::Int), ColumnSpec::new("qty", Type::Int)],
vec![
ColumnSpec::new("id", Type::Int),
ColumnSpec::new("qty", Type::Int),
],
vec!["id".to_string()],
Some("create".to_string()),
))
@@ -129,7 +131,11 @@ fn insert_with_case_variant_table_persists_and_survives_rebuild() {
.block_on(db.query_data("Items".to_string(), None, None))
.expect("query")
.rows;
assert_eq!(rows.len(), 1, "the wrong-case insert survived the rebuild (no data loss)");
assert_eq!(
rows.len(),
1,
"the wrong-case insert survived the rebuild (no data loss)"
);
assert_eq!(rows[0][1].as_deref(), Some("kept"));
}
@@ -146,9 +152,19 @@ fn add_column_with_case_variant_table_survives_rebuild() {
);
let db = fresh_rebuild(db, &project, &r);
let desc = r.block_on(db.describe_table("Items".to_string())).expect("describe");
let qty = desc.columns.iter().find(|c| c.name == "qty").expect("qty added");
assert_eq!(qty.user_type, Some(Type::Int), "qty's user-type survived the rebuild");
let desc = r
.block_on(db.describe_table("Items".to_string()))
.expect("describe");
let qty = desc
.columns
.iter()
.find(|c| c.name == "qty")
.expect("qty added");
assert_eq!(
qty.user_type,
Some(Type::Int),
"qty's user-type survived the rebuild"
);
// The CHECK is intact too (a negative qty is refused under the real table).
assert!(
r.block_on(db.insert(
@@ -175,9 +191,15 @@ fn drop_table_with_case_variant_name_clears_table_and_csv() {
insert into Items (id, note) values (1, 'x')\n\
drop table items\n",
);
assert!(!tables(&db, &r).contains(&"Items".to_string()), "the table was dropped");
assert!(
!tables(&db, &r).contains(&"Items".to_string()),
"the table was dropped"
);
let csv = project.path().join(project::DATA_DIR).join("Items.csv");
assert!(!csv.exists(), "the CSV was removed despite the case-variant drop");
assert!(
!csv.exists(),
"the CSV was removed despite the case-variant drop"
);
// A fresh rebuild yields no Items (the metadata/yaml has no orphan).
let db = fresh_rebuild(db, &project, &r);
@@ -224,12 +246,24 @@ fn add_relationship_with_case_variant_tables_survives_rebuild() {
add 1:n relationship from parent.id to child.parent_id\n",
);
// The parent's inbound relationship is visible under the stored case.
let p = r.block_on(db.describe_table("Parent".to_string())).expect("describe Parent");
assert_eq!(p.inbound_relationships.len(), 1, "relationship recorded under the stored case");
let p = r
.block_on(db.describe_table("Parent".to_string()))
.expect("describe Parent");
assert_eq!(
p.inbound_relationships.len(),
1,
"relationship recorded under the stored case"
);
assert_eq!(p.inbound_relationships[0].other_table, "Child");
let db = fresh_rebuild(db, &project, &r);
let p = r.block_on(db.describe_table("Parent".to_string())).expect("describe Parent");
assert_eq!(p.inbound_relationships.len(), 1, "relationship survived the rebuild");
let p = r
.block_on(db.describe_table("Parent".to_string()))
.expect("describe Parent");
assert_eq!(
p.inbound_relationships.len(),
1,
"relationship survived the rebuild"
);
assert_eq!(p.inbound_relationships[0].other_table, "Child");
}