mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Remove needless lifetimes
This commit is contained in:
parent
62d5ffe678
commit
4c4578851b
@ -33,7 +33,7 @@ impl Connection {
|
|||||||
///
|
///
|
||||||
/// Will return `Err` if `sql` cannot be converted to a C-compatible string
|
/// Will return `Err` if `sql` cannot be converted to a C-compatible string
|
||||||
/// or if the underlying SQLite call fails.
|
/// or if the underlying SQLite call fails.
|
||||||
pub fn prepare_cached<'a>(&'a self, sql: &str) -> Result<CachedStatement<'a>> {
|
pub fn prepare_cached(&self, sql: &str) -> Result<CachedStatement<'_>> {
|
||||||
self.cache.get(self, sql)
|
self.cache.get(self, sql)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ use crate::types::{ToSqlOutput, ValueRef};
|
|||||||
#[cfg(feature = "array")]
|
#[cfg(feature = "array")]
|
||||||
use crate::vtab::array::{free_array, ARRAY_TYPE};
|
use crate::vtab::array::{free_array, ARRAY_TYPE};
|
||||||
|
|
||||||
pub(crate) unsafe fn set_result<'a>(ctx: *mut sqlite3_context, result: &ToSqlOutput<'a>) {
|
pub(crate) unsafe fn set_result(ctx: *mut sqlite3_context, result: &ToSqlOutput<'_>) {
|
||||||
let value = match *result {
|
let value = match *result {
|
||||||
ToSqlOutput::Borrowed(v) => v,
|
ToSqlOutput::Borrowed(v) => v,
|
||||||
ToSqlOutput::Owned(ref v) => ValueRef::from(v),
|
ToSqlOutput::Owned(ref v) => ValueRef::from(v),
|
||||||
|
@ -567,7 +567,7 @@ impl Connection {
|
|||||||
///
|
///
|
||||||
/// Will return `Err` if `sql` cannot be converted to a C-compatible string
|
/// Will return `Err` if `sql` cannot be converted to a C-compatible string
|
||||||
/// or if the underlying SQLite call fails.
|
/// or if the underlying SQLite call fails.
|
||||||
pub fn prepare<'a>(&'a self, sql: &str) -> Result<Statement<'a>> {
|
pub fn prepare(&self, sql: &str) -> Result<Statement<'_>> {
|
||||||
self.db.borrow_mut().prepare(self, sql)
|
self.db.borrow_mut().prepare(self, sql)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ impl Changeset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create an iterator to traverse a changeset
|
/// Create an iterator to traverse a changeset
|
||||||
pub fn iter<'changeset>(&'changeset self) -> Result<ChangesetIter<'changeset>> {
|
pub fn iter(&self) -> Result<ChangesetIter<'_>> {
|
||||||
let mut it: *mut ffi::sqlite3_changeset_iter = unsafe { mem::uninitialized() };
|
let mut it: *mut ffi::sqlite3_changeset_iter = unsafe { mem::uninitialized() };
|
||||||
check!(unsafe { ffi::sqlite3changeset_start(&mut it, self.n, self.cs) });
|
check!(unsafe { ffi::sqlite3changeset_start(&mut it, self.n, self.cs) });
|
||||||
Ok(ChangesetIter {
|
Ok(ChangesetIter {
|
||||||
|
@ -186,7 +186,7 @@ impl<'conn> Statement<'conn> {
|
|||||||
/// ## Failure
|
/// ## Failure
|
||||||
///
|
///
|
||||||
/// Will return `Err` if binding parameters fails.
|
/// Will return `Err` if binding parameters fails.
|
||||||
pub fn query<'a, P>(&'a mut self, params: P) -> Result<Rows<'a>>
|
pub fn query<P>(&mut self, params: P) -> Result<Rows<'_>>
|
||||||
where
|
where
|
||||||
P: IntoIterator,
|
P: IntoIterator,
|
||||||
P::Item: ToSql,
|
P::Item: ToSql,
|
||||||
@ -263,7 +263,7 @@ impl<'conn> Statement<'conn> {
|
|||||||
/// ## Failure
|
/// ## Failure
|
||||||
///
|
///
|
||||||
/// Will return `Err` if binding parameters fails.
|
/// Will return `Err` if binding parameters fails.
|
||||||
pub fn query_map<'a, T, P, F>(&'a mut self, params: P, f: F) -> Result<MappedRows<'a, F>>
|
pub fn query_map<T, P, F>(&mut self, params: P, f: F) -> Result<MappedRows<'_, F>>
|
||||||
where
|
where
|
||||||
P: IntoIterator,
|
P: IntoIterator,
|
||||||
P::Item: ToSql,
|
P::Item: ToSql,
|
||||||
@ -319,11 +319,7 @@ impl<'conn> Statement<'conn> {
|
|||||||
/// # Failure
|
/// # Failure
|
||||||
///
|
///
|
||||||
/// Will return `Err` if binding parameters fails.
|
/// Will return `Err` if binding parameters fails.
|
||||||
pub fn query_and_then<'a, T, E, P, F>(
|
pub fn query_and_then<T, E, P, F>(&mut self, params: P, f: F) -> Result<AndThenRows<'_, F>>
|
||||||
&'a mut self,
|
|
||||||
params: P,
|
|
||||||
f: F,
|
|
||||||
) -> Result<AndThenRows<'a, F>>
|
|
||||||
where
|
where
|
||||||
P: IntoIterator,
|
P: IntoIterator,
|
||||||
P::Item: ToSql,
|
P::Item: ToSql,
|
||||||
|
Loading…
Reference in New Issue
Block a user