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;
88/// Extension trait for the [SqliteConnection] type.
99pub trait ConnectionExtensions {
1010 /// 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 > (
1212 & self ,
1313 sql : Q ,
1414 params : & [ Value ] ,
1515 ) -> StdResult < T > ;
1616}
1717
1818impl ConnectionExtensions for SqliteConnection {
19- fn query_single_cell < Q : Into < String > , T : ReadableWithIndex > (
19+ fn query_single_cell < Q : AsRef < str > , T : ReadableWithIndex > (
2020 & self ,
2121 sql : Q ,
2222 params : & [ Value ] ,
2323 ) -> StdResult < T > {
24- let sql = sql. into ( ) ;
2524 let mut statement = self . prepare ( & sql) . with_context ( || {
2625 format ! (
2726 "Prepare query error: SQL=`{}`" ,
28- & sql. replace( '\n' , " " ) . trim( )
27+ sql. as_ref ( ) . replace( '\n' , " " ) . trim( )
2928 )
3029 } ) ?;
3130 statement. bind ( params) ?;
You can’t perform that action at this time.
0 commit comments