diff --git a/src/db/sqlite_adapter.rs b/src/db/sqlite_adapter.rs index b640e273..cb778eb5 100644 --- a/src/db/sqlite_adapter.rs +++ b/src/db/sqlite_adapter.rs @@ -426,15 +426,20 @@ impl<'a> ITx for SqliteTx<'a> { // complicated, they must hold the Statement and Row objects // therefore quite some unsafe code (it is a self-referential struct) -struct DbValueIterator<'a> { +struct DbValueIterator { db: Connection, - stmt: Option>, - iter: Option>, + // These two are not really static (they are actually self referential :o) + stmt: Option>, + iter: Option>, _pin: PhantomPinned, } -impl<'a> DbValueIterator<'a> { - fn make(db: Connection, sql: &str, args: P) -> Result> { +impl DbValueIterator { + fn make<'res, P: rusqlite::Params>( + db: Connection, + sql: &str, + args: P, + ) -> Result> { let res = DbValueIterator { db, stmt: None, @@ -468,7 +473,7 @@ impl<'a> DbValueIterator<'a> { } } -impl<'a> Drop for DbValueIterator<'a> { +impl Drop for DbValueIterator { fn drop(&mut self) { trace!("drop iter"); drop(self.iter.take()); @@ -476,9 +481,9 @@ impl<'a> Drop for DbValueIterator<'a> { } } -struct DbValueIteratorPin<'a>(Pin>>); +struct DbValueIteratorPin(Pin>); -impl<'a> Iterator for DbValueIteratorPin<'a> { +impl Iterator for DbValueIteratorPin { type Item = Result<(Value, Value)>; fn next(&mut self) -> Option {