chore(qa): format code and configure clippy lints
This commit is contained in:
@@ -792,13 +792,7 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
|
||||
let db_std = Database::open(&path_std).expect("Open std db");
|
||||
db_std
|
||||
.init_schema(
|
||||
&salt_std,
|
||||
&kdf_params,
|
||||
&wrapped_std,
|
||||
&nonce_std,
|
||||
&tag_std,
|
||||
)
|
||||
.init_schema(&salt_std, &kdf_params, &wrapped_std, &nonce_std, &tag_std)
|
||||
.expect("Init std schema");
|
||||
db_std.checkpoint().unwrap();
|
||||
|
||||
@@ -842,25 +836,26 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
let conn_std = rusqlite::Connection::open(&path_std).unwrap();
|
||||
let conn_hidden = rusqlite::Connection::open(&path_hidden).unwrap();
|
||||
|
||||
let get_schema_elements = |conn: &rusqlite::Connection| -> Vec<(String, String, Option<String>)> {
|
||||
let mut stmt = conn
|
||||
.prepare(
|
||||
"SELECT type, name, sql FROM sqlite_master
|
||||
let get_schema_elements =
|
||||
|conn: &rusqlite::Connection| -> Vec<(String, String, Option<String>)> {
|
||||
let mut stmt = conn
|
||||
.prepare(
|
||||
"SELECT type, name, sql FROM sqlite_master
|
||||
WHERE type IN ('table', 'index') AND name NOT LIKE 'sqlite_%'
|
||||
ORDER BY type, name",
|
||||
)
|
||||
.unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, String>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, Option<String>>(2)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
)
|
||||
.unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, String>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, Option<String>>(2)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
|
||||
let schema_std = get_schema_elements(&conn_std);
|
||||
let schema_hidden = get_schema_elements(&conn_hidden);
|
||||
@@ -872,22 +867,25 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
|
||||
// Spalten- und Typinformationen vergleichen
|
||||
for table in &["meta", "nodes", "chunks"] {
|
||||
let get_table_info = |conn: &rusqlite::Connection| -> Vec<(i64, String, String, i64, Option<String>, i64)> {
|
||||
let mut stmt = conn.prepare(&format!("PRAGMA table_info({});", table)).unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, i64>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, String>(2)?,
|
||||
row.get::<_, i64>(3)?,
|
||||
row.get::<_, Option<String>>(4)?,
|
||||
row.get::<_, i64>(5)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
let get_table_info =
|
||||
|conn: &rusqlite::Connection| -> Vec<(i64, String, String, i64, Option<String>, i64)> {
|
||||
let mut stmt = conn
|
||||
.prepare(&format!("PRAGMA table_info({});", table))
|
||||
.unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, i64>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, String>(2)?,
|
||||
row.get::<_, i64>(3)?,
|
||||
row.get::<_, Option<String>>(4)?,
|
||||
row.get::<_, i64>(5)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
|
||||
let cols_std = get_table_info(&conn_std);
|
||||
let cols_hidden = get_table_info(&conn_hidden);
|
||||
@@ -925,4 +923,3 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
let _ = std::fs::remove_file(&path_std);
|
||||
let _ = std::fs::remove_file(&path_hidden);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user