Remove some usages of params! / NO_PARAMS

This commit is contained in:
gwenn 2020-11-22 09:37:00 +01:00
parent 6fae5d6641
commit 32ee895b63
2 changed files with 7 additions and 8 deletions

View File

@ -31,7 +31,7 @@ fn main() -> Result<()> {
name TEXT NOT NULL, name TEXT NOT NULL,
data BLOB data BLOB
)", )",
params![], [],
)?; )?;
let me = Person { let me = Person {
id: 0, id: 0,
@ -44,7 +44,7 @@ fn main() -> Result<()> {
)?; )?;
let mut stmt = conn.prepare("SELECT id, name, data FROM person")?; let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
let person_iter = stmt.query_map(params![], |row| { let person_iter = stmt.query_map([], |row| {
Ok(Person { Ok(Person {
id: row.get(0)?, id: row.get(0)?,
name: row.get(1)?, name: row.get(1)?,

View File

@ -20,7 +20,7 @@
//! name TEXT NOT NULL, //! name TEXT NOT NULL,
//! data BLOB //! data BLOB
//! )", //! )",
//! params![], //! [],
//! )?; //! )?;
//! let me = Person { //! let me = Person {
//! id: 0, //! id: 0,
@ -33,7 +33,7 @@
//! )?; //! )?;
//! //!
//! let mut stmt = conn.prepare("SELECT id, name, data FROM person")?; //! let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
//! let person_iter = stmt.query_map(params![], |row| { //! let person_iter = stmt.query_map([], |row| {
//! Ok(Person { //! Ok(Person {
//! id: row.get(0)?, //! id: row.get(0)?,
//! name: row.get(1)?, //! name: row.get(1)?,
@ -455,8 +455,7 @@ impl Connection {
/// ```rust,no_run /// ```rust,no_run
/// # use rusqlite::{Connection, Result}; /// # use rusqlite::{Connection, Result};
/// fn create_tables(conn: &Connection) -> Result<()> { /// fn create_tables(conn: &Connection) -> Result<()> {
/// conn.execute_batch( /// conn.execute_batch("BEGIN;
/// "BEGIN;
/// CREATE TABLE foo(x INTEGER); /// CREATE TABLE foo(x INTEGER);
/// CREATE TABLE bar(y TEXT); /// CREATE TABLE bar(y TEXT);
/// COMMIT;", /// COMMIT;",
@ -859,7 +858,7 @@ impl fmt::Debug for Connection {
/// Batch iterator /// Batch iterator
/// ```rust /// ```rust
/// use rusqlite::{Batch, Connection, Result, NO_PARAMS}; /// use rusqlite::{Batch, Connection, Result};
/// ///
/// fn main() -> Result<()> { /// fn main() -> Result<()> {
/// let conn = Connection::open_in_memory()?; /// let conn = Connection::open_in_memory()?;
@ -869,7 +868,7 @@ impl fmt::Debug for Connection {
/// "; /// ";
/// let mut batch = Batch::new(&conn, sql); /// let mut batch = Batch::new(&conn, sql);
/// while let Some(mut stmt) = batch.next()? { /// while let Some(mut stmt) = batch.next()? {
/// stmt.execute(NO_PARAMS)?; /// stmt.execute([])?;
/// } /// }
/// Ok(()) /// Ok(())
/// } /// }