diff options
Diffstat (limited to 'tests/schema_ownership.rs')
| -rw-r--r-- | tests/schema_ownership.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/tests/schema_ownership.rs b/tests/schema_ownership.rs index 34fb184..9df7fa5 100644 --- a/tests/schema_ownership.rs +++ b/tests/schema_ownership.rs @@ -1,13 +1,12 @@ use std::path::{Path, PathBuf}; const SQL_LITERALS: &[&str] = &[ - "\"SELECT", "\"select", "\"INSERT", "\"insert", "\"UPDATE", "\"update", "\"DELETE", "\"delete", - "\"PRAGMA", "\"WITH", + "\"SELECT", "\"select", "\"INSERT", "\"insert", "\"UPDATE", "\"update", "\"DELETE", "\"delete", "\"PRAGMA", + "\"WITH", ]; -const STATEMENT_CALLS: &[&str] = &[ - ".query_row(", ".query_map(", ".execute(", ".execute_batch(", ".prepare(", ".pragma_query_value(", -]; +const STATEMENT_CALLS: &[&str] = + &[".query_row(", ".query_map(", ".execute(", ".execute_batch(", ".prepare(", ".pragma_query_value("]; fn rust_files(dir: &Path, out: &mut Vec<PathBuf>) { for entry in std::fs::read_dir(dir).expect("read_dir") { @@ -47,11 +46,7 @@ fn no_sql_statements_outside_the_db_module() { } } } - assert!( - offenders.is_empty(), - "SQL belongs to `db/`. Move these into a typed query:\n{}", - offenders.join("\n") - ); + assert!(offenders.is_empty(), "SQL belongs to `db/`. Move these into a typed query:\n{}", offenders.join("\n")); } #[test] @@ -83,9 +78,6 @@ trait StripPath { impl StripPath for PathBuf { fn strip_path(&self, root: &Path) -> String { - self.strip_prefix(root) - .unwrap_or(self.as_path()) - .to_string_lossy() - .replace('\\', "/") + self.strip_prefix(root).unwrap_or(self.as_path()).to_string_lossy().replace('\\', "/") } } |
