diff --git a/Cargo.toml b/Cargo.toml index 8d6cd57d..c66ba1fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ prometheus = ["prometheus/push", "prometheus/process"] # Enable integration tests with a running TiKV and PD instance. # Use $PD_ADDRS, comma separated, to set the addresses the tests use. integration-tests = [] -apiv2-no-prefix = [] [lib] name = "tikv_client" diff --git a/Makefile b/Makefile index 6e22ead3..ef3fd397 100644 --- a/Makefile +++ b/Makefile @@ -5,11 +5,11 @@ export RUSTFLAGS=-Dwarnings export PD_ADDRS ?= 127.0.0.1:2379 export MULTI_REGION ?= 1 -ALL_FEATURES := integration-tests apiv2-no-prefix +ALL_FEATURES := integration-tests NEXTEST_ARGS := --config-file $(shell pwd)/config/nextest.toml -INTEGRATION_TEST_ARGS := --features "integration-tests apiv2-no-prefix" --test-threads 1 +INTEGRATION_TEST_ARGS := --features "integration-tests" --test-threads 1 RUN_INTEGRATION_TEST := cargo nextest run ${NEXTEST_ARGS} --all ${INTEGRATION_TEST_ARGS} diff --git a/README.md b/README.md index 3841cf63..7e5e6d9a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The TiKV client is a Rust library (crate). To use this crate in your project, ad ```toml [dependencies] -tikv-client = "0.3" +tikv-client = "0.4" ``` ### Prerequisites diff --git a/src/request/keyspace.rs b/src/request/keyspace.rs index 94fd5f76..35ad4e64 100644 --- a/src/request/keyspace.rs +++ b/src/request/keyspace.rs @@ -13,6 +13,7 @@ pub const TXN_KEY_PREFIX: u8 = b'x'; pub const KEYSPACE_PREFIX_LEN: usize = 4; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[non_exhaustive] pub enum Keyspace { Disable, Enable { @@ -23,7 +24,6 @@ pub enum Keyspace { /// This mode is intended for **server-side embedding** use cases (e.g. embedding this client in /// `tikv-server`) where keys are already in API V2 "logical key bytes" form and must be passed /// through unchanged. - #[cfg(feature = "apiv2-no-prefix")] ApiV2NoPrefix, } @@ -38,7 +38,6 @@ impl Keyspace { match self { Keyspace::Disable => kvrpcpb::ApiVersion::V1, Keyspace::Enable { .. } => kvrpcpb::ApiVersion::V2, - #[cfg(feature = "apiv2-no-prefix")] Keyspace::ApiV2NoPrefix => kvrpcpb::ApiVersion::V2, } } @@ -293,7 +292,6 @@ mod tests { assert_eq!(key.truncate_keyspace(keyspace), expected_key); } - #[cfg(feature = "apiv2-no-prefix")] #[test] fn test_apiv2_no_prefix_api_version() { assert_eq!( @@ -302,7 +300,6 @@ mod tests { ); } - #[cfg(feature = "apiv2-no-prefix")] #[test] fn test_apiv2_no_prefix_encode_is_noop() { let keyspace = Keyspace::ApiV2NoPrefix; @@ -325,7 +322,6 @@ mod tests { ); } - #[cfg(feature = "apiv2-no-prefix")] #[test] fn test_apiv2_no_prefix_truncate_is_noop() { let keyspace = Keyspace::ApiV2NoPrefix; diff --git a/src/transaction/client.rs b/src/transaction/client.rs index 22873b0c..e28d452a 100644 --- a/src/transaction/client.rs +++ b/src/transaction/client.rs @@ -125,7 +125,6 @@ impl Client { /// keyspace/key-mode prefix, with a custom configuration. /// /// This is intended for **server-side embedding** use cases. `config.keyspace` must be unset. - #[cfg(feature = "apiv2-no-prefix")] pub async fn new_with_config_api_v2_no_prefix>( pd_endpoints: Vec, config: Config,