File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
internal/mithril-persistence/src/sqlite Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,23 @@ use crate::sqlite::SqliteConnection;
8
8
/// Extension trait for the [SqliteConnection] type.
9
9
pub trait ConnectionExtensions {
10
10
/// Execute the given sql query and return the value of the first cell read.
11
- fn query_single_cell < Q : Into < String > , T : ReadableWithIndex > (
11
+ fn query_single_cell < Q : AsRef < str > , T : ReadableWithIndex > (
12
12
& self ,
13
13
sql : Q ,
14
14
params : & [ Value ] ,
15
15
) -> StdResult < T > ;
16
16
}
17
17
18
18
impl ConnectionExtensions for SqliteConnection {
19
- fn query_single_cell < Q : Into < String > , T : ReadableWithIndex > (
19
+ fn query_single_cell < Q : AsRef < str > , T : ReadableWithIndex > (
20
20
& self ,
21
21
sql : Q ,
22
22
params : & [ Value ] ,
23
23
) -> StdResult < T > {
24
- let sql = sql. into ( ) ;
25
24
let mut statement = self . prepare ( & sql) . with_context ( || {
26
25
format ! (
27
26
"Prepare query error: SQL=`{}`" ,
28
- & sql. replace( '\n' , " " ) . trim( )
27
+ sql. as_ref ( ) . replace( '\n' , " " ) . trim( )
29
28
)
30
29
} ) ?;
31
30
statement. bind ( params) ?;
You can’t perform that action at this time.
0 commit comments