From 165e8a86381008d5f57864be0ca91d82080ae5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przytu=C5=82a?= Date: Wed, 8 May 2024 08:37:27 +0200 Subject: [PATCH] scylla-cql: add assert_matches as dev-dep This will be helpful in testing deserialization framework, and will also be used in serialization instead of assert!(matches!(...)). As a bonus, Cargo.toml of all crates was auto formatted. --- Cargo.lock.msrv | 1 + scylla-cql/Cargo.toml | 12 ++++++++++-- scylla-macros/Cargo.toml | 4 ++-- scylla-proxy/Cargo.toml | 10 +++++++++- scylla/Cargo.toml | 29 +++++++++++++++++++++++++---- 5 files changed, 47 insertions(+), 9 deletions(-) diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index 776cc09f56..4ddbe9dae1 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -1524,6 +1524,7 @@ dependencies = [ name = "scylla-cql" version = "0.2.0" dependencies = [ + "assert_matches", "async-trait", "bigdecimal", "byteorder", diff --git a/scylla-cql/Cargo.toml b/scylla-cql/Cargo.toml index 75753dded7..b81ecb69c9 100644 --- a/scylla-cql/Cargo.toml +++ b/scylla-cql/Cargo.toml @@ -28,7 +28,8 @@ serde = { version = "1.0", features = ["derive"], optional = true } time = { version = "0.3", optional = true } [dev-dependencies] -criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0 +assert_matches = "1.5.0" +criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0 # Use large-dates feature to test potential edge cases time = { version = "0.3.21", features = ["large-dates"] } @@ -43,7 +44,14 @@ chrono = ["dep:chrono"] num-bigint-03 = ["dep:num-bigint-03"] num-bigint-04 = ["dep:num-bigint-04"] bigdecimal-04 = ["dep:bigdecimal-04"] -full-serialization = ["chrono", "time", "secret", "num-bigint-03", "num-bigint-04", "bigdecimal-04"] +full-serialization = [ + "chrono", + "time", + "secret", + "num-bigint-03", + "num-bigint-04", + "bigdecimal-04", +] [lints.rust] unreachable_pub = "warn" diff --git a/scylla-macros/Cargo.toml b/scylla-macros/Cargo.toml index 9d015b50ea..2b3b954966 100644 --- a/scylla-macros/Cargo.toml +++ b/scylla-macros/Cargo.toml @@ -14,8 +14,8 @@ proc-macro = true [dependencies] darling = "0.20.0" syn = "2.0" -quote = "1.0" +quote = "1.0" proc-macro2 = "1.0" [lints.rust] -unreachable_pub = "warn" \ No newline at end of file +unreachable_pub = "warn" diff --git a/scylla-proxy/Cargo.toml b/scylla-proxy/Cargo.toml index 704c81061d..694fb32a58 100644 --- a/scylla-proxy/Cargo.toml +++ b/scylla-proxy/Cargo.toml @@ -17,7 +17,15 @@ scylla-cql = { version = "0.2.0", path = "../scylla-cql" } byteorder = "1.3.4" bytes = "1.2.0" futures = "0.3.6" -tokio = { version = "1.12", features = ["net", "time", "io-util", "sync", "rt", "macros", "rt-multi-thread"] } +tokio = { version = "1.12", features = [ + "net", + "time", + "io-util", + "sync", + "rt", + "macros", + "rt-multi-thread", +] } uuid = "1.0" thiserror = "1.0.32" bigdecimal = "0.4" diff --git a/scylla/Cargo.toml b/scylla/Cargo.toml index 028406f6ca..5c4667c95e 100644 --- a/scylla/Cargo.toml +++ b/scylla/Cargo.toml @@ -16,14 +16,28 @@ rustdoc-args = ["--cfg", "docsrs"] [features] default = [] ssl = ["dep:tokio-openssl", "dep:openssl"] -cloud = ["ssl", "scylla-cql/serde", "dep:serde_yaml", "dep:serde", "dep:url", "dep:base64"] +cloud = [ + "ssl", + "scylla-cql/serde", + "dep:serde_yaml", + "dep:serde", + "dep:url", + "dep:base64", +] secret = ["scylla-cql/secret"] chrono = ["scylla-cql/chrono"] time = ["scylla-cql/time"] num-bigint-03 = ["scylla-cql/num-bigint-03"] num-bigint-04 = ["scylla-cql/num-bigint-04"] bigdecimal-04 = ["scylla-cql/bigdecimal-04"] -full-serialization = ["chrono", "time", "secret", "num-bigint-03", "num-bigint-04", "bigdecimal-04"] +full-serialization = [ + "chrono", + "time", + "secret", + "num-bigint-03", + "num-bigint-04", + "bigdecimal-04", +] [dependencies] scylla-macros = { version = "0.5.0", path = "../scylla-macros" } @@ -33,7 +47,14 @@ bytes = "1.0.1" futures = "0.3.6" hashbrown = "0.14" histogram = "0.6.9" -tokio = { version = "1.34", features = ["net", "time", "io-util", "sync", "rt", "macros"] } +tokio = { version = "1.34", features = [ + "net", + "time", + "io-util", + "sync", + "rt", + "macros", +] } snap = "1.0" uuid = { version = "1.0", features = ["v4"] } rand = "0.8.3" @@ -62,7 +83,7 @@ num-bigint-04 = { package = "num-bigint", version = "0.4" } bigdecimal-04 = { package = "bigdecimal", version = "0.4" } scylla-proxy = { version = "0.0.3", path = "../scylla-proxy" } ntest = "0.9.0" -criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0 +criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0 tokio = { version = "1.27", features = ["test-util"] } tracing-subscriber = { version = "0.3.14", features = ["env-filter"] } assert_matches = "1.5.0"