@@ -13,6 +13,7 @@ use std::io::{stderr, Write};
13
13
use std:: mem:: ManuallyDrop ;
14
14
use std:: os:: raw as libc;
15
15
use std:: ptr:: { self , NonNull } ;
16
+
16
17
#[ allow( missing_debug_implementations) ]
17
18
pub ( in crate :: sqlite) struct Statement {
18
19
inner_statement : NonNull < ffi:: sqlite3_stmt > ,
@@ -59,12 +60,6 @@ impl Statement {
59
60
value : & SqliteBindValue < ' _ > ,
60
61
bind_index : i32 ,
61
62
) -> QueryResult < ( ) > {
62
- // This unsafe block assumes the following invariants:
63
- //
64
- // - `stmt` points to valid memory
65
- // - If `self.ty` is anything other than `Binary` or `Text`, the appropriate
66
- // number of bytes were written to `value` for an integer of the
67
- // corresponding size.
68
63
let result = match ( tpe, value) {
69
64
( _, SqliteBindValue :: Null ) => {
70
65
ffi:: sqlite3_bind_null ( self . inner_statement . as_ptr ( ) , bind_index)
@@ -214,7 +209,7 @@ impl<'stmt, 'query> BoundStatement<'stmt, 'query> {
214
209
where
215
210
T : QueryFragment < Sqlite > + QueryId + ' query ,
216
211
{
217
- // Don't use a trait object here to prevent using virtual function call
212
+ // Don't use a trait object here to prevent using a virtual function call
218
213
// For sqlite this can introduce a measurable overhead
219
214
let mut query = ManuallyDrop :: new ( query) ;
220
215
@@ -363,8 +358,8 @@ impl<'stmt, 'query> StatementUse<'stmt, 'query> {
363
358
// https://sqlite.org/c3ref/column_name.html
364
359
//
365
360
// Note: This function is marked as unsafe, as calling it can invalidate
366
- // any existing column name pointer. It should maximally be called once
367
- // per column at all.
361
+ // any existing column name pointer. To prevent that,
362
+ // it should maximally be called once per column at all.
368
363
pub ( super ) unsafe fn column_name ( & self , idx : i32 ) -> * const str {
369
364
let name = {
370
365
let column_name =
0 commit comments