@@ -40,7 +40,7 @@ impl VssStore {
40
40
41
41
fn extract_key ( & self , unified_key : & str ) -> io:: Result < String > {
42
42
let mut parts = unified_key. splitn ( 3 , '#' ) ;
43
- let ( _ , _ ) = ( parts. next ( ) , parts. next ( ) ) ; // Discard primary_namespace & secondary_namespace
43
+ let ( _primary_namespace , _secondary_namespace ) = ( parts. next ( ) , parts. next ( ) ) ;
44
44
match parts. next ( ) {
45
45
Some ( actual_key) => Ok ( actual_key. to_string ( ) ) ,
46
46
None => Err ( Error :: new ( ErrorKind :: InvalidData , "Invalid key format" ) ) ,
@@ -84,7 +84,7 @@ impl KVStore for VssStore {
84
84
) -> io:: Result < Vec < u8 > > {
85
85
check_namespace_key_validity ( primary_namespace, secondary_namespace, Some ( key) , "read" ) ?;
86
86
let request = GetObjectRequest {
87
- store_id : self . store_id . to_string ( ) ,
87
+ store_id : self . store_id . clone ( ) ,
88
88
key : self . build_key ( primary_namespace, secondary_namespace, key) ?,
89
89
} ;
90
90
@@ -93,7 +93,7 @@ impl KVStore for VssStore {
93
93
. map_err ( |e| match e {
94
94
VssError :: NoSuchKeyError ( ..) => {
95
95
let msg = format ! (
96
- "Failed to read as key could not be found: {}/{}/{}. Details : {}" ,
96
+ "Failed to read from key {}/{}/{}: {}" ,
97
97
primary_namespace, secondary_namespace, key, e
98
98
) ;
99
99
Error :: new ( ErrorKind :: NotFound , msg)
@@ -114,7 +114,7 @@ impl KVStore for VssStore {
114
114
) -> io:: Result < ( ) > {
115
115
check_namespace_key_validity ( primary_namespace, secondary_namespace, Some ( key) , "write" ) ?;
116
116
let request = PutObjectRequest {
117
- store_id : self . store_id . to_string ( ) ,
117
+ store_id : self . store_id . clone ( ) ,
118
118
global_version : None ,
119
119
transaction_items : vec ! [ KeyValue {
120
120
key: self . build_key( primary_namespace, secondary_namespace, key) ?,
@@ -141,7 +141,7 @@ impl KVStore for VssStore {
141
141
) -> io:: Result < ( ) > {
142
142
check_namespace_key_validity ( primary_namespace, secondary_namespace, Some ( key) , "remove" ) ?;
143
143
let request = DeleteObjectRequest {
144
- store_id : self . store_id . to_string ( ) ,
144
+ store_id : self . store_id . clone ( ) ,
145
145
key_value : Some ( KeyValue {
146
146
key : self . build_key ( primary_namespace, secondary_namespace, key) ?,
147
147
version : -1 ,
0 commit comments