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;
#[macro_use]
extern crate serde_derive;
extern crate bytes;
extern crate edn;
extern crate uuid;
extern crate bytes;
#[macro_use]
extern crate lazy_static;

View file

@ -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)),
}
}

View file

@ -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())
);
}

View file

@ -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.

View file

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