mirror of
https://github.com/isar/rusqlite.git
synced 2025-09-16 12:42:18 +08:00
Update for int/uint -> isize/usize
This commit is contained in:
12
src/lib.rs
12
src/lib.rs
@@ -210,7 +210,7 @@ impl SqliteConnection {
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
pub fn execute(&self, sql: &str, params: &[&ToSql]) -> SqliteResult<uint> {
|
||||
pub fn execute(&self, sql: &str, params: &[&ToSql]) -> SqliteResult<c_int> {
|
||||
self.prepare(sql).and_then(|mut stmt| stmt.execute(params))
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ impl SqliteConnection {
|
||||
self.db.borrow_mut().decode_result(code)
|
||||
}
|
||||
|
||||
fn changes(&self) -> uint {
|
||||
fn changes(&self) -> c_int {
|
||||
self.db.borrow_mut().changes()
|
||||
}
|
||||
}
|
||||
@@ -390,8 +390,8 @@ impl InnerSqliteConnection {
|
||||
})
|
||||
}
|
||||
|
||||
fn changes(&mut self) -> uint {
|
||||
unsafe{ ffi::sqlite3_changes(self.db) as uint }
|
||||
fn changes(&mut self) -> c_int {
|
||||
unsafe{ ffi::sqlite3_changes(self.db) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ impl<'conn> SqliteStatement<'conn> {
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
pub fn execute(&mut self, params: &[&ToSql]) -> SqliteResult<uint> {
|
||||
pub fn execute(&mut self, params: &[&ToSql]) -> SqliteResult<c_int> {
|
||||
self.reset_if_needed();
|
||||
|
||||
unsafe {
|
||||
@@ -796,7 +796,7 @@ mod test {
|
||||
assert_eq!(db.last_insert_rowid(), 1);
|
||||
|
||||
let mut stmt = db.prepare("INSERT INTO foo DEFAULT VALUES").unwrap();
|
||||
for _ in range(0i, 9) {
|
||||
for _ in range(0i32, 9) {
|
||||
stmt.execute(&[]).unwrap();
|
||||
}
|
||||
assert_eq!(db.last_insert_rowid(), 10);
|
||||
|
Reference in New Issue
Block a user