@@ -204,12 +204,12 @@ pub enum TransactionAny<K: TransactionKind> {
204
204
}
205
205
206
206
impl < K : TransactionKind > TransactionAny < K > {
207
- pub async fn open_db ( & self , db : Option < String > ) -> Result < DatabaseAny > {
207
+ pub async fn open_db ( & self , db : Option < & str > ) -> Result < DatabaseAny > {
208
208
match self {
209
- Self :: Local ( tx) => Ok ( DatabaseAny :: Local (
210
- tx. open_db ( db. as_ref ( ) . map ( |t| t. as_str ( ) ) ) ?,
209
+ Self :: Local ( tx) => Ok ( DatabaseAny :: Local ( tx. open_db ( db) ?) ) ,
210
+ Self :: Remote ( tx) => Ok ( DatabaseAny :: Remote (
211
+ tx. open_db ( db. map ( |t| t. to_string ( ) ) ) . await ?,
211
212
) ) ,
212
- Self :: Remote ( tx) => Ok ( DatabaseAny :: Remote ( tx. open_db ( db) . await ?) ) ,
213
213
}
214
214
}
215
215
@@ -274,12 +274,12 @@ impl TransactionAny<RW> {
274
274
}
275
275
}
276
276
277
- pub async fn create_db ( & self , db : Option < String > , flags : DatabaseFlags ) -> Result < DatabaseAny > {
277
+ pub async fn create_db ( & self , db : Option < & str > , flags : DatabaseFlags ) -> Result < DatabaseAny > {
278
278
match self {
279
- Self :: Local ( tx) => Ok ( DatabaseAny :: Local (
280
- tx. create_db ( db. as_ref ( ) . map ( |t| t. as_str ( ) ) , flags) ?,
279
+ Self :: Local ( tx) => Ok ( DatabaseAny :: Local ( tx. create_db ( db, flags) ?) ) ,
280
+ Self :: Remote ( tx) => Ok ( DatabaseAny :: Remote (
281
+ tx. create_db ( db. map ( |t| t. to_string ( ) ) , flags) . await ?,
281
282
) ) ,
282
- Self :: Remote ( tx) => Ok ( DatabaseAny :: Remote ( tx. create_db ( db, flags) . await ?) ) ,
283
283
}
284
284
}
285
285
0 commit comments