mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Fix clippy warnings
This commit is contained in:
parent
781d5b9fdd
commit
5730b2f952
@ -181,7 +181,10 @@ mod build_bundled {
|
|||||||
|
|
||||||
if cfg!(feature = "bundled-sqlcipher-vendored-openssl") {
|
if cfg!(feature = "bundled-sqlcipher-vendored-openssl") {
|
||||||
cfg.include(std::env::var("DEP_OPENSSL_INCLUDE").unwrap());
|
cfg.include(std::env::var("DEP_OPENSSL_INCLUDE").unwrap());
|
||||||
println!("cargo:rustc-link-lib=static=crypto"); // cargo will resolve downstream to the static lib in openssl-sys
|
println!("cargo:rustc-link-lib=static=crypto"); // cargo will
|
||||||
|
// resolve downstream
|
||||||
|
// to the static
|
||||||
|
// lib in openssl-sys
|
||||||
} else if is_windows {
|
} else if is_windows {
|
||||||
// FIXME README says that bundled-sqlcipher is Unix only, and the sources are
|
// FIXME README says that bundled-sqlcipher is Unix only, and the sources are
|
||||||
// configured on a Unix machine. So maybe this should be made unreachable.
|
// configured on a Unix machine. So maybe this should be made unreachable.
|
||||||
|
@ -670,7 +670,7 @@ impl Connection {
|
|||||||
stmt.check_no_tail()?;
|
stmt.check_no_tail()?;
|
||||||
let mut rows = stmt.query(params)?;
|
let mut rows = stmt.query(params)?;
|
||||||
|
|
||||||
rows.get_expected_row().map_err(E::from).and_then(|r| f(&r))
|
rows.get_expected_row().map_err(E::from).and_then(|r| f(r))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Prepare a SQL statement for execution.
|
/// Prepare a SQL statement for execution.
|
||||||
|
@ -198,7 +198,7 @@ impl Connection {
|
|||||||
let mut rows = stmt.query([])?;
|
let mut rows = stmt.query([])?;
|
||||||
while let Some(result_row) = rows.next()? {
|
while let Some(result_row) = rows.next()? {
|
||||||
let row = result_row;
|
let row = result_row;
|
||||||
f(&row)?;
|
f(row)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ impl Connection {
|
|||||||
let mut rows = stmt.query([])?;
|
let mut rows = stmt.query([])?;
|
||||||
while let Some(result_row) = rows.next()? {
|
while let Some(result_row) = rows.next()? {
|
||||||
let row = result_row;
|
let row = result_row;
|
||||||
f(&row)?;
|
f(row)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ where
|
|||||||
self.rows
|
self.rows
|
||||||
.next()
|
.next()
|
||||||
.transpose()
|
.transpose()
|
||||||
.map(|row_result| row_result.and_then(|row| (map)(&row)))
|
.map(|row_result| row_result.and_then(|row| (map)(row)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ where
|
|||||||
self.rows
|
self.rows
|
||||||
.next()
|
.next()
|
||||||
.transpose()
|
.transpose()
|
||||||
.map(|row_result| row_result.map_err(E::from).and_then(|row| (map)(&row)))
|
.map(|row_result| row_result.map_err(E::from).and_then(|row| (map)(row)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ impl<'stmt> FallibleStreamingIterator for Rows<'stmt> {
|
|||||||
#[inline]
|
#[inline]
|
||||||
fn advance(&mut self) -> Result<()> {
|
fn advance(&mut self) -> Result<()> {
|
||||||
match self.stmt {
|
match self.stmt {
|
||||||
Some(ref stmt) => match stmt.step() {
|
Some(stmt) => match stmt.step() {
|
||||||
Ok(true) => {
|
Ok(true) => {
|
||||||
self.row = Some(Row { stmt });
|
self.row = Some(Row { stmt });
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -453,7 +453,7 @@ impl Statement<'_> {
|
|||||||
{
|
{
|
||||||
let mut rows = self.query(params)?;
|
let mut rows = self.query(params)?;
|
||||||
|
|
||||||
rows.get_expected_row().and_then(|r| f(&r))
|
rows.get_expected_row().and_then(|r| f(r))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convenience method to execute a query with named parameter(s) that is
|
/// Convenience method to execute a query with named parameter(s) that is
|
||||||
|
@ -212,7 +212,7 @@ unsafe impl<'vtab> VTab<'vtab> for CsvTab {
|
|||||||
if n_col.is_none() && schema.is_none() {
|
if n_col.is_none() && schema.is_none() {
|
||||||
cols = headers
|
cols = headers
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|header| escape_double_quote(&header).into_owned())
|
.map(|header| escape_double_quote(header).into_owned())
|
||||||
.collect();
|
.collect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ fn test_dummy_module() -> rusqlite::Result<()> {
|
|||||||
|
|
||||||
let db = Connection::open_in_memory()?;
|
let db = Connection::open_in_memory()?;
|
||||||
|
|
||||||
db.create_module::<DummyTab>("dummy", &module, None)?;
|
db.create_module::<DummyTab>("dummy", module, None)?;
|
||||||
|
|
||||||
let version = version_number();
|
let version = version_number();
|
||||||
if version < 3_008_012 {
|
if version < 3_008_012 {
|
||||||
|
Loading…
Reference in New Issue
Block a user