Upgrade to time v0.2 and put it behind a feature flag

This also removes the usage of time in the crate's top-level
documentation example, as was done for the README in #625.

Fix #653.
This commit is contained in:
Nikhil Benesch
2020-07-11 11:59:29 -04:00
committed by Thom Chiovoloni
parent 464b8283b2
commit b83d22e2b7
5 changed files with 79 additions and 74 deletions

View File

@@ -3,13 +3,11 @@
//!
//! ```rust
//! use rusqlite::{params, Connection, Result};
//! use time::Timespec;
//!
//! #[derive(Debug)]
//! struct Person {
//! id: i32,
//! name: String,
//! time_created: Timespec,
//! data: Option<Vec<u8>>,
//! }
//!
@@ -20,7 +18,6 @@
//! "CREATE TABLE person (
//! id INTEGER PRIMARY KEY,
//! name TEXT NOT NULL,
//! time_created TEXT NOT NULL,
//! data BLOB
//! )",
//! params![],
@@ -28,22 +25,19 @@
//! let me = Person {
//! id: 0,
//! name: "Steven".to_string(),
//! time_created: time::get_time(),
//! data: None,
//! };
//! conn.execute(
//! "INSERT INTO person (name, time_created, data)
//! VALUES (?1, ?2, ?3)",
//! params![me.name, me.time_created, me.data],
//! "INSERT INTO person (name, data) VALUES (?1, ?2)",
//! params![me.name, me.data],
//! )?;
//!
//! let mut stmt = conn.prepare("SELECT id, name, time_created, data FROM person")?;
//! let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
//! let person_iter = stmt.query_map(params![], |row| {
//! Ok(Person {
//! id: row.get(0)?,
//! name: row.get(1)?,
//! time_created: row.get(2)?,
//! data: row.get(3)?,
//! data: row.get(2)?,
//! })
//! })?;
//!