From eae76e6f433f98ce853ed0c0704a2db06e676461 Mon Sep 17 00:00:00 2001 From: Mark Watts Date: Mon, 23 Aug 2021 21:31:50 -0400 Subject: [PATCH] cargo fmt --- core-traits/lib.rs | 2 +- db/src/db.rs | 4 +--- db/tests/value_tests.rs | 4 ++-- edn/tests/tests.rs | 5 ++--- sql/src/lib.rs | 3 +-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/core-traits/lib.rs b/core-traits/lib.rs index c09495fc..53380b11 100644 --- a/core-traits/lib.rs +++ b/core-traits/lib.rs @@ -14,9 +14,9 @@ extern crate indexmap; extern crate ordered_float; #[macro_use] extern crate serde_derive; +extern crate bytes; extern crate edn; extern crate uuid; -extern crate bytes; #[macro_use] extern crate lazy_static; diff --git a/db/src/db.rs b/db/src/db.rs index 66589b4f..36a9f330 100644 --- a/db/src/db.rs +++ b/db/src/db.rs @@ -434,9 +434,7 @@ impl TypedSQLValue for TypedValue { Ok(TypedValue::Uuid(u)) } (13, rusqlite::types::Value::Text(x)) => to_namespaced_keyword(&x).map(|k| k.into()), - (15, rusqlite::types::Value::Blob(x)) => { - Ok(TypedValue::Bytes(x.into())) - } + (15, rusqlite::types::Value::Blob(x)) => Ok(TypedValue::Bytes(x.into())), (_, value) => bail!(DbErrorKind::BadSQLValuePair(value, value_type_tag)), } } diff --git a/db/tests/value_tests.rs b/db/tests/value_tests.rs index 08637cba..6e1cbd57 100644 --- a/db/tests/value_tests.rs +++ b/db/tests/value_tests.rs @@ -68,9 +68,9 @@ fn test_from_sql_value_pair() { TypedValue::typed_ns_keyword("db", "keyword") ); assert_eq!( - TypedValue::from_sql_value_pair(rusqlite::types::Value::Blob(vec![1,2,3,42]), 15) + TypedValue::from_sql_value_pair(rusqlite::types::Value::Blob(vec![1, 2, 3, 42]), 15) .unwrap(), - TypedValue::Bytes((vec![1,2,3,42]).into()) + TypedValue::Bytes((vec![1, 2, 3, 42]).into()) ); } diff --git a/edn/tests/tests.rs b/edn/tests/tests.rs index 2baa6923..09b6185f 100644 --- a/edn/tests/tests.rs +++ b/edn/tests/tests.rs @@ -336,12 +336,12 @@ fn test_bytes() { 1, 2, 3, 5, 4, 3, 2, 42 ))) ); - let data = r#"[ { :test/instant #inst "2018-01-01T11:00:00Z" :test/bytes #bytes 010203050403022a } ]"#; + let data = + r#"[ { :test/instant #inst "2018-01-01T11:00:00Z" :test/bytes #bytes 010203050403022a } ]"#; let result = parse::value(data).unwrap().without_spans().to_string(); assert_eq!(data, result); } - #[test] fn test_entities() { let d2 = r#"[ { :test/boolean true :test/long 33 :test/double 1.4 :test/string "foo" :test/keyword :foo/bar :test/uuid #uuid "12341234-1234-1234-1234-123412341234" :test/instant #inst "2018-01-01T11:00:00Z" :test/ref 1 :test/bytes #bytes 010203050403022a } ]"#; @@ -349,7 +349,6 @@ fn test_entities() { assert!(r2.is_ok()); } - #[test] fn test_inst() { assert!(parse::value("#inst\"2016-01-01T11:00:00.000Z\"").is_err()); // No whitespace. diff --git a/sql/src/lib.rs b/sql/src/lib.rs index ca9683f4..a702a8dc 100644 --- a/sql/src/lib.rs +++ b/sql/src/lib.rs @@ -191,8 +191,7 @@ impl QueryBuilder for SQLiteQueryBuilder { self.push_named_arg(arg.as_str()); self.byte_args.insert(bytes, arg); } - - }, + } } Ok(()) }