diff --git a/Cargo.toml b/Cargo.toml index c2a69c91..c3d4055e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,22 +24,22 @@ byteorder = "^1.3" chrono-tz = "0.5" crossbeam = "0.8.0" thiserror = "1.0.20" -futures-core = "0.3.5" -futures-sink = "0.3.5" +futures-core = "0.3.16" +futures-sink = "0.3.16" hostname = "^0.3" lazy_static = "1.4.0" lz4 = "1.23.2" -pin-project = "1.0.4" +pin-project = "1.0.8" url="^2" uuid = "0.8.1" combine = "4.2.3" [dependencies.futures-util] -version = "0.3.12" +version = "0.3.16" features = ["sink"] [dependencies.tokio] -version = "1.5" +version = "1.10" default-features = false features = ["io-util", "time", "net", "sync", "rt-multi-thread"] optional = true @@ -70,10 +70,10 @@ default-features = false features = [ "std" ] [dev-dependencies] -env_logger = "^0.8" +env_logger = "^0.9" rand = "^0.8" [dev-dependencies.tokio] -version = "1.5" +version = "1.10" default-features = false features = ["macros"] diff --git a/src/types/value.rs b/src/types/value.rs index a43c7e59..0bb8bb86 100644 --- a/src/types/value.rs +++ b/src/types/value.rs @@ -322,10 +322,7 @@ impl convert::From for Value { impl convert::From for Value { fn from(v: bool) -> Value { - match v { - true => Value::UInt8(1_u8), - false => Value::UInt8(0_u8), - } + Value::UInt8(if v {1} else {0}) } } @@ -558,10 +555,8 @@ mod test { #[test] fn test_boolean() { - let f = false; - let t = true; - let v = Value::from(f); - let w = Value::from(t); + let v = Value::from(false); + let w = Value::from(true); assert_eq!(v, Value::UInt8(0)); assert_eq!(w, Value::UInt8(1)); }