File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 9
9
//! use time::Timespec;
10
10
//!
11
11
//!
12
- //! use sqlite3::{DatabaseConnection, SqliteResult, SqliteError, ToSql };
12
+ //! use sqlite3::{DatabaseConnection, SqliteResult, SqliteError};
13
13
//!
14
14
//! #[deriving(Show)]
15
15
//! struct Person {
46
46
//! {
47
47
//! let mut tx = try!(conn.prepare("INSERT INTO person (name, time_created)
48
48
//! VALUES ($1, $2)"));
49
- //! let changes = try!(conn.update(&mut tx, [&me.name as &ToSql , &me.time_created as &ToSql ]));
49
+ //! let changes = try!(conn.update(&mut tx, & [&me.name, &me.time_created]));
50
50
//! assert_eq!(changes, 1);
51
51
//! }
52
52
//!
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ extern crate sqlite3;
4
4
use time:: Timespec ;
5
5
6
6
7
- use sqlite3:: { DatabaseConnection , SqliteResult , SqliteError , ToSql } ;
7
+ use sqlite3:: { DatabaseConnection , SqliteResult , SqliteError } ;
8
8
9
9
#[ deriving( Show ) ]
10
10
struct Person {
@@ -41,7 +41,7 @@ fn with_conn(conn: &mut DatabaseConnection) -> SqliteResult<Vec<Person>> {
41
41
{
42
42
let mut tx = try!( conn. prepare ( "INSERT INTO person (name, time_created)
43
43
VALUES ($1, $2)" ) ) ;
44
- let changes = try!( conn. update ( & mut tx, [ & me. name as & ToSql , & me. time_created as & ToSql ] ) ) ;
44
+ let changes = try!( conn. update ( & mut tx, & [ & me. name , & me. time_created ] ) ) ;
45
45
assert_eq ! ( changes, 1 ) ;
46
46
}
47
47
You can’t perform that action at this time.
0 commit comments