@@ -13,6 +13,7 @@ pub const TXN_KEY_PREFIX: u8 = b'x';
1313pub const KEYSPACE_PREFIX_LEN : usize = 4 ;
1414
1515#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
16+ #[ non_exhaustive]
1617pub enum Keyspace {
1718 Disable ,
1819 Enable {
@@ -23,7 +24,6 @@ pub enum Keyspace {
2324 /// This mode is intended for **server-side embedding** use cases (e.g. embedding this client in
2425 /// `tikv-server`) where keys are already in API V2 "logical key bytes" form and must be passed
2526 /// through unchanged.
26- #[ cfg( feature = "apiv2-no-prefix" ) ]
2727 ApiV2NoPrefix ,
2828}
2929
@@ -38,7 +38,6 @@ impl Keyspace {
3838 match self {
3939 Keyspace :: Disable => kvrpcpb:: ApiVersion :: V1 ,
4040 Keyspace :: Enable { .. } => kvrpcpb:: ApiVersion :: V2 ,
41- #[ cfg( feature = "apiv2-no-prefix" ) ]
4241 Keyspace :: ApiV2NoPrefix => kvrpcpb:: ApiVersion :: V2 ,
4342 }
4443 }
@@ -293,7 +292,6 @@ mod tests {
293292 assert_eq ! ( key. truncate_keyspace( keyspace) , expected_key) ;
294293 }
295294
296- #[ cfg( feature = "apiv2-no-prefix" ) ]
297295 #[ test]
298296 fn test_apiv2_no_prefix_api_version ( ) {
299297 assert_eq ! (
@@ -302,7 +300,6 @@ mod tests {
302300 ) ;
303301 }
304302
305- #[ cfg( feature = "apiv2-no-prefix" ) ]
306303 #[ test]
307304 fn test_apiv2_no_prefix_encode_is_noop ( ) {
308305 let keyspace = Keyspace :: ApiV2NoPrefix ;
@@ -325,7 +322,6 @@ mod tests {
325322 ) ;
326323 }
327324
328- #[ cfg( feature = "apiv2-no-prefix" ) ]
329325 #[ test]
330326 fn test_apiv2_no_prefix_truncate_is_noop ( ) {
331327 let keyspace = Keyspace :: ApiV2NoPrefix ;
0 commit comments