cargo fmt

This commit is contained in:
Mark Watts 2021-08-23 21:31:50 -04:00
parent bd818ba1f1
commit eae76e6f43
5 changed files with 7 additions and 11 deletions

View file

@ -14,9 +14,9 @@ extern crate indexmap;
extern crate ordered_float; extern crate ordered_float;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
extern crate bytes;
extern crate edn; extern crate edn;
extern crate uuid; extern crate uuid;
extern crate bytes;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;

View file

@ -434,9 +434,7 @@ impl TypedSQLValue for TypedValue {
Ok(TypedValue::Uuid(u)) Ok(TypedValue::Uuid(u))
} }
(13, rusqlite::types::Value::Text(x)) => to_namespaced_keyword(&x).map(|k| k.into()), (13, rusqlite::types::Value::Text(x)) => to_namespaced_keyword(&x).map(|k| k.into()),
(15, rusqlite::types::Value::Blob(x)) => { (15, rusqlite::types::Value::Blob(x)) => Ok(TypedValue::Bytes(x.into())),
Ok(TypedValue::Bytes(x.into()))
}
(_, value) => bail!(DbErrorKind::BadSQLValuePair(value, value_type_tag)), (_, value) => bail!(DbErrorKind::BadSQLValuePair(value, value_type_tag)),
} }
} }

View file

@ -336,12 +336,12 @@ fn test_bytes() {
1, 2, 3, 5, 4, 3, 2, 42 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(); let result = parse::value(data).unwrap().without_spans().to_string();
assert_eq!(data, result); assert_eq!(data, result);
} }
#[test] #[test]
fn test_entities() { 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 } ]"#; 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()); assert!(r2.is_ok());
} }
#[test] #[test]
fn test_inst() { fn test_inst() {
assert!(parse::value("#inst\"2016-01-01T11:00:00.000Z\"").is_err()); // No whitespace. assert!(parse::value("#inst\"2016-01-01T11:00:00.000Z\"").is_err()); // No whitespace.

View file

@ -191,8 +191,7 @@ impl QueryBuilder for SQLiteQueryBuilder {
self.push_named_arg(arg.as_str()); self.push_named_arg(arg.as_str());
self.byte_args.insert(bytes, arg); self.byte_args.insert(bytes, arg);
} }
}
},
} }
Ok(()) Ok(())
} }