@@ -55,6 +55,8 @@ impl FilesystemStore {
55
55
impl KVStore for FilesystemStore {
56
56
fn read ( & self , namespace : & str , key : & str ) -> std:: io:: Result < Vec < u8 > > {
57
57
if key. is_empty ( ) {
58
+ debug_assert ! ( false , "Failed to read {}/{}: key may not be empty." ,
59
+ PrintableString ( namespace) , PrintableString ( key) ) ;
58
60
let msg = format ! ( "Failed to read {}/{}: key may not be empty." ,
59
61
PrintableString ( namespace) , PrintableString ( key) ) ;
60
62
return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , msg) ) ;
@@ -89,6 +91,8 @@ impl KVStore for FilesystemStore {
89
91
90
92
fn write ( & self , namespace : & str , key : & str , buf : & [ u8 ] ) -> std:: io:: Result < ( ) > {
91
93
if key. is_empty ( ) {
94
+ debug_assert ! ( false , "Failed to write {}/{}: key may not be empty." ,
95
+ PrintableString ( namespace) , PrintableString ( key) ) ;
92
96
let msg = format ! ( "Failed to write {}/{}: key may not be empty." ,
93
97
PrintableString ( namespace) , PrintableString ( key) ) ;
94
98
return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , msg) ) ;
@@ -174,6 +178,8 @@ impl KVStore for FilesystemStore {
174
178
175
179
fn remove ( & self , namespace : & str , key : & str ) -> std:: io:: Result < ( ) > {
176
180
if key. is_empty ( ) {
181
+ debug_assert ! ( false , "Failed to remove {}/{}: key may not be empty." ,
182
+ PrintableString ( namespace) , PrintableString ( key) ) ;
177
183
let msg = format ! ( "Failed to remove {}/{}: key may not be empty." ,
178
184
PrintableString ( namespace) , PrintableString ( key) ) ;
179
185
return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , msg) ) ;
0 commit comments