From 38870944ba1669e75da5e300bb3ae8e28ffc84da Mon Sep 17 00:00:00 2001 From: muzarski Date: Thu, 22 Feb 2024 16:19:15 +0100 Subject: [PATCH] cargo: rename `secret` feature to `secrecy-08` --- .github/workflows/rust.yml | 2 +- scylla-cql/Cargo.toml | 6 +++--- scylla-cql/src/frame/response/cql_to_rust.rs | 6 +++--- scylla-cql/src/frame/value.rs | 6 +++--- scylla-cql/src/frame/value_tests.rs | 4 ++-- scylla-cql/src/types/serialize/value.rs | 6 +++--- scylla/Cargo.toml | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a53d4ef59e..092cc8d3a5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -35,7 +35,7 @@ jobs: - name: Cargo check with all serialization features run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "full-serialization" - name: Cargo check with secret feature - run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "secret" + run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "secrecy-08" - name: Cargo check with chrono feature run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "chrono" - name: Cargo check with time feature diff --git a/scylla-cql/Cargo.toml b/scylla-cql/Cargo.toml index a996789dbc..1ca097a86d 100644 --- a/scylla-cql/Cargo.toml +++ b/scylla-cql/Cargo.toml @@ -14,7 +14,7 @@ scylla-macros = { version = "0.4.0", path = "../scylla-macros" } byteorder = "1.3.4" bytes = "1.0.1" tokio = { version = "1.12", features = ["io-util", "time"] } -secrecy = { version = "0.8", optional = true } +secrecy-08 = { package = "secrecy", version = "0.8", optional = true } snap = "1.0" uuid = "1.0" thiserror = "1.0" @@ -37,10 +37,10 @@ name = "benchmark" harness = false [features] -secret = ["secrecy"] +secrecy-08 = ["dep:secrecy-08"] time = ["dep:time"] 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", "secrecy-08", "num-bigint-03", "num-bigint-04", "bigdecimal-04"] diff --git a/scylla-cql/src/frame/response/cql_to_rust.rs b/scylla-cql/src/frame/response/cql_to_rust.rs index f40f2346fb..a56a726fc5 100644 --- a/scylla-cql/src/frame/response/cql_to_rust.rs +++ b/scylla-cql/src/frame/response/cql_to_rust.rs @@ -11,8 +11,8 @@ use uuid::Uuid; #[cfg(feature = "chrono")] use chrono::{DateTime, NaiveDate, NaiveTime, Utc}; -#[cfg(feature = "secret")] -use secrecy::{Secret, Zeroize}; +#[cfg(feature = "secrecy-08")] +use secrecy_08::{Secret, Zeroize}; #[derive(Error, Debug, Clone, PartialEq, Eq)] pub enum FromRowError { @@ -240,7 +240,7 @@ impl FromCqlVal for time::OffsetDateTime { } } -#[cfg(feature = "secret")] +#[cfg(feature = "secrecy-08")] impl + Zeroize> FromCqlVal for Secret { fn from_cql(cql_val: CqlValue) -> Result { Ok(Secret::new(FromCqlVal::from_cql(cql_val)?)) diff --git a/scylla-cql/src/frame/value.rs b/scylla-cql/src/frame/value.rs index 991d9ad59d..ffa2396996 100644 --- a/scylla-cql/src/frame/value.rs +++ b/scylla-cql/src/frame/value.rs @@ -16,8 +16,8 @@ use super::response::result::CqlValue; use super::types::vint_encode; use super::types::RawValue; -#[cfg(feature = "secret")] -use secrecy::{ExposeSecret, Secret, Zeroize}; +#[cfg(feature = "secrecy-08")] +use secrecy_08::{ExposeSecret, Secret, Zeroize}; /// Every value being sent in a query must implement this trait /// serialize() should write the Value as [bytes] to the provided buffer @@ -1070,7 +1070,7 @@ impl Value for time::Time { } } -#[cfg(feature = "secret")] +#[cfg(feature = "secrecy-08")] impl Value for Secret { fn serialize(&self, buf: &mut Vec) -> Result<(), ValueTooBig> { self.expose_secret().serialize(buf) diff --git a/scylla-cql/src/frame/value_tests.rs b/scylla-cql/src/frame/value_tests.rs index debf979249..63fbe389e9 100644 --- a/scylla-cql/src/frame/value_tests.rs +++ b/scylla-cql/src/frame/value_tests.rs @@ -871,10 +871,10 @@ fn cqlvalue_serialization() { ); } -#[cfg(feature = "secret")] +#[cfg(feature = "secrecy-08")] #[test] fn secret_serialization() { - use secrecy::Secret; + use secrecy_08::Secret; let secret = Secret::new(987654i32); assert_eq!( serialized(secret, ColumnType::Int), diff --git a/scylla-cql/src/types/serialize/value.rs b/scylla-cql/src/types/serialize/value.rs index 39403f3c48..6583f7b002 100644 --- a/scylla-cql/src/types/serialize/value.rs +++ b/scylla-cql/src/types/serialize/value.rs @@ -12,8 +12,8 @@ use uuid::Uuid; #[cfg(feature = "chrono")] use chrono::{DateTime, NaiveDate, NaiveTime, Utc}; -#[cfg(feature = "secret")] -use secrecy::{ExposeSecret, Secret, Zeroize}; +#[cfg(feature = "secrecy-08")] +use secrecy_08::{ExposeSecret, Secret, Zeroize}; use crate::frame::response::result::{ColumnType, CqlValue}; use crate::frame::types::vint_encode; @@ -205,7 +205,7 @@ impl SerializeCql for time::Time { ::serialize(&(*me).into(), typ, writer)? }); } -#[cfg(feature = "secret")] +#[cfg(feature = "secrecy-08")] impl SerializeCql for Secret { fn serialize<'b>( &self, diff --git a/scylla/Cargo.toml b/scylla/Cargo.toml index 665679c8e7..7fe0f4d5fd 100644 --- a/scylla/Cargo.toml +++ b/scylla/Cargo.toml @@ -17,13 +17,13 @@ rustdoc-args = ["--cfg", "docsrs"] default = [] ssl = ["dep:tokio-openssl", "dep:openssl"] cloud = ["ssl", "scylla-cql/serde", "dep:serde_yaml", "dep:serde", "dep:url", "dep:base64"] -secret = ["scylla-cql/secret"] +secrecy-08 = ["scylla-cql/secrecy-08"] 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", "secrecy-08", "num-bigint-03", "num-bigint-04", "bigdecimal-04"] [dependencies] scylla-macros = { version = "0.4.0", path = "../scylla-macros" }