Skip to content

Commit

Permalink
run rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
drdo committed Jun 29, 2024
1 parent 6ad3ddc commit a9789ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
33 changes: 16 additions & 17 deletions src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,22 @@ impl Cache {
})
};
let raw_path_id = o_path_id_to_raw_u64(path_id);
let cte_stmt_string =
get_tables(&self.conn)?
.into_iter()
.filter(|name| name.starts_with("entries_"))
.map(|table| {
format!(
"SELECT \
path_id, \
component, \
size, \
is_dir \
FROM \"{table}\" JOIN paths ON path_id = paths.id \
WHERE parent_id = {raw_path_id}\n"
)
})
.intersperse(String::from(" UNION ALL "))
.collect::<String>();
let cte_stmt_string = get_tables(&self.conn)?
.into_iter()
.filter(|name| name.starts_with("entries_"))
.map(|table| {
format!(
"SELECT \
path_id, \
component, \
size, \
is_dir \
FROM \"{table}\" JOIN paths ON path_id = paths.id \
WHERE parent_id = {raw_path_id}\n"
)
})
.intersperse(String::from(" UNION ALL "))
.collect::<String>();
let mut stmt = self.conn.prepare(&format!(
"WITH rich_entries AS ({cte_stmt_string}) \
SELECT \
Expand Down
6 changes: 1 addition & 5 deletions src/cache/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,7 @@ fn test_migrate_v0_to_v1() {
let cache =
Migrator::open_with_target(&file, 1).unwrap().migrate().unwrap();

assert_tables(&cache.conn, &[
"metadata_integer",
"paths",
"marks",
]);
assert_tables(&cache.conn, &["metadata_integer", "paths", "marks"]);

assert_marks(&cache, &marks);

Expand Down

0 comments on commit a9789ed

Please sign in to comment.