mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 19:41:37 +08:00
Clippy + rust fmt
This commit is contained in:
parent
0acdb19a38
commit
15fc3b4b71
@ -31,7 +31,6 @@ fn main() {
|
|||||||
|
|
||||||
#[cfg(any(feature = "bundled", all(windows, feature = "bundled-windows")))]
|
#[cfg(any(feature = "bundled", all(windows, feature = "bundled-windows")))]
|
||||||
mod build_bundled {
|
mod build_bundled {
|
||||||
use cc;
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
@ -154,8 +153,6 @@ impl From<HeaderLocation> for String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod build_linked {
|
mod build_linked {
|
||||||
use pkg_config;
|
|
||||||
|
|
||||||
#[cfg(all(feature = "vcpkg", target_env = "msvc"))]
|
#[cfg(all(feature = "vcpkg", target_env = "msvc"))]
|
||||||
extern crate vcpkg;
|
extern crate vcpkg;
|
||||||
|
|
||||||
@ -301,8 +298,6 @@ mod bindings {
|
|||||||
|
|
||||||
#[cfg(feature = "buildtime_bindgen")]
|
#[cfg(feature = "buildtime_bindgen")]
|
||||||
mod bindings {
|
mod bindings {
|
||||||
use bindgen;
|
|
||||||
|
|
||||||
use super::HeaderLocation;
|
use super::HeaderLocation;
|
||||||
use bindgen::callbacks::{IntKind, ParseCallbacks};
|
use bindgen::callbacks::{IntKind, ParseCallbacks};
|
||||||
|
|
||||||
|
@ -125,67 +125,67 @@ const SQLITE_WARNING: c_int = 28;
|
|||||||
|
|
||||||
// Extended result codes.
|
// Extended result codes.
|
||||||
|
|
||||||
const SQLITE_ERROR_MISSING_COLLSEQ: c_int = (super::SQLITE_ERROR | (1 << 8));
|
const SQLITE_ERROR_MISSING_COLLSEQ: c_int = super::SQLITE_ERROR | (1 << 8);
|
||||||
const SQLITE_ERROR_RETRY: c_int = (super::SQLITE_ERROR | (2 << 8));
|
const SQLITE_ERROR_RETRY: c_int = super::SQLITE_ERROR | (2 << 8);
|
||||||
const SQLITE_ERROR_SNAPSHOT: c_int = (super::SQLITE_ERROR | (3 << 8));
|
const SQLITE_ERROR_SNAPSHOT: c_int = super::SQLITE_ERROR | (3 << 8);
|
||||||
|
|
||||||
const SQLITE_IOERR_SHMOPEN: c_int = (super::SQLITE_IOERR | (18 << 8));
|
const SQLITE_IOERR_SHMOPEN: c_int = super::SQLITE_IOERR | (18 << 8);
|
||||||
const SQLITE_IOERR_SHMSIZE: c_int = (super::SQLITE_IOERR | (19 << 8));
|
const SQLITE_IOERR_SHMSIZE: c_int = super::SQLITE_IOERR | (19 << 8);
|
||||||
const SQLITE_IOERR_SHMLOCK: c_int = (super::SQLITE_IOERR | (20 << 8));
|
const SQLITE_IOERR_SHMLOCK: c_int = super::SQLITE_IOERR | (20 << 8);
|
||||||
const SQLITE_IOERR_SHMMAP: c_int = (super::SQLITE_IOERR | (21 << 8));
|
const SQLITE_IOERR_SHMMAP: c_int = super::SQLITE_IOERR | (21 << 8);
|
||||||
const SQLITE_IOERR_SEEK: c_int = (super::SQLITE_IOERR | (22 << 8));
|
const SQLITE_IOERR_SEEK: c_int = super::SQLITE_IOERR | (22 << 8);
|
||||||
const SQLITE_IOERR_DELETE_NOENT: c_int = (super::SQLITE_IOERR | (23 << 8));
|
const SQLITE_IOERR_DELETE_NOENT: c_int = super::SQLITE_IOERR | (23 << 8);
|
||||||
const SQLITE_IOERR_MMAP: c_int = (super::SQLITE_IOERR | (24 << 8));
|
const SQLITE_IOERR_MMAP: c_int = super::SQLITE_IOERR | (24 << 8);
|
||||||
const SQLITE_IOERR_GETTEMPPATH: c_int = (super::SQLITE_IOERR | (25 << 8));
|
const SQLITE_IOERR_GETTEMPPATH: c_int = super::SQLITE_IOERR | (25 << 8);
|
||||||
const SQLITE_IOERR_CONVPATH: c_int = (super::SQLITE_IOERR | (26 << 8));
|
const SQLITE_IOERR_CONVPATH: c_int = super::SQLITE_IOERR | (26 << 8);
|
||||||
const SQLITE_IOERR_VNODE: c_int = (super::SQLITE_IOERR | (27 << 8));
|
const SQLITE_IOERR_VNODE: c_int = super::SQLITE_IOERR | (27 << 8);
|
||||||
const SQLITE_IOERR_AUTH: c_int = (super::SQLITE_IOERR | (28 << 8));
|
const SQLITE_IOERR_AUTH: c_int = super::SQLITE_IOERR | (28 << 8);
|
||||||
const SQLITE_IOERR_BEGIN_ATOMIC: c_int = (super::SQLITE_IOERR | (29 << 8));
|
const SQLITE_IOERR_BEGIN_ATOMIC: c_int = super::SQLITE_IOERR | (29 << 8);
|
||||||
const SQLITE_IOERR_COMMIT_ATOMIC: c_int = (super::SQLITE_IOERR | (30 << 8));
|
const SQLITE_IOERR_COMMIT_ATOMIC: c_int = super::SQLITE_IOERR | (30 << 8);
|
||||||
const SQLITE_IOERR_ROLLBACK_ATOMIC: c_int = (super::SQLITE_IOERR | (31 << 8));
|
const SQLITE_IOERR_ROLLBACK_ATOMIC: c_int = super::SQLITE_IOERR | (31 << 8);
|
||||||
|
|
||||||
const SQLITE_LOCKED_SHAREDCACHE: c_int = (super::SQLITE_LOCKED | (1 << 8));
|
const SQLITE_LOCKED_SHAREDCACHE: c_int = super::SQLITE_LOCKED | (1 << 8);
|
||||||
const SQLITE_LOCKED_VTAB: c_int = (super::SQLITE_LOCKED | (2 << 8));
|
const SQLITE_LOCKED_VTAB: c_int = super::SQLITE_LOCKED | (2 << 8);
|
||||||
|
|
||||||
const SQLITE_BUSY_RECOVERY: c_int = (super::SQLITE_BUSY | (1 << 8));
|
const SQLITE_BUSY_RECOVERY: c_int = super::SQLITE_BUSY | (1 << 8);
|
||||||
const SQLITE_BUSY_SNAPSHOT: c_int = (super::SQLITE_BUSY | (2 << 8));
|
const SQLITE_BUSY_SNAPSHOT: c_int = super::SQLITE_BUSY | (2 << 8);
|
||||||
|
|
||||||
const SQLITE_CANTOPEN_NOTEMPDIR: c_int = (super::SQLITE_CANTOPEN | (1 << 8));
|
const SQLITE_CANTOPEN_NOTEMPDIR: c_int = super::SQLITE_CANTOPEN | (1 << 8);
|
||||||
const SQLITE_CANTOPEN_ISDIR: c_int = (super::SQLITE_CANTOPEN | (2 << 8));
|
const SQLITE_CANTOPEN_ISDIR: c_int = super::SQLITE_CANTOPEN | (2 << 8);
|
||||||
const SQLITE_CANTOPEN_FULLPATH: c_int = (super::SQLITE_CANTOPEN | (3 << 8));
|
const SQLITE_CANTOPEN_FULLPATH: c_int = super::SQLITE_CANTOPEN | (3 << 8);
|
||||||
const SQLITE_CANTOPEN_CONVPATH: c_int = (super::SQLITE_CANTOPEN | (4 << 8));
|
const SQLITE_CANTOPEN_CONVPATH: c_int = super::SQLITE_CANTOPEN | (4 << 8);
|
||||||
const SQLITE_CANTOPEN_SYMLINK: c_int = (super::SQLITE_CANTOPEN | (6 << 8));
|
const SQLITE_CANTOPEN_SYMLINK: c_int = super::SQLITE_CANTOPEN | (6 << 8);
|
||||||
|
|
||||||
const SQLITE_CORRUPT_VTAB: c_int = (super::SQLITE_CORRUPT | (1 << 8));
|
const SQLITE_CORRUPT_VTAB: c_int = super::SQLITE_CORRUPT | (1 << 8);
|
||||||
const SQLITE_CORRUPT_SEQUENCE: c_int = (super::SQLITE_CORRUPT | (2 << 8));
|
const SQLITE_CORRUPT_SEQUENCE: c_int = super::SQLITE_CORRUPT | (2 << 8);
|
||||||
|
|
||||||
const SQLITE_READONLY_RECOVERY: c_int = (super::SQLITE_READONLY | (1 << 8));
|
const SQLITE_READONLY_RECOVERY: c_int = super::SQLITE_READONLY | (1 << 8);
|
||||||
const SQLITE_READONLY_CANTLOCK: c_int = (super::SQLITE_READONLY | (2 << 8));
|
const SQLITE_READONLY_CANTLOCK: c_int = super::SQLITE_READONLY | (2 << 8);
|
||||||
const SQLITE_READONLY_ROLLBACK: c_int = (super::SQLITE_READONLY | (3 << 8));
|
const SQLITE_READONLY_ROLLBACK: c_int = super::SQLITE_READONLY | (3 << 8);
|
||||||
const SQLITE_READONLY_DBMOVED: c_int = (super::SQLITE_READONLY | (4 << 8));
|
const SQLITE_READONLY_DBMOVED: c_int = super::SQLITE_READONLY | (4 << 8);
|
||||||
const SQLITE_READONLY_CANTINIT: c_int = (super::SQLITE_READONLY | (5 << 8));
|
const SQLITE_READONLY_CANTINIT: c_int = super::SQLITE_READONLY | (5 << 8);
|
||||||
const SQLITE_READONLY_DIRECTORY: c_int = (super::SQLITE_READONLY | (6 << 8));
|
const SQLITE_READONLY_DIRECTORY: c_int = super::SQLITE_READONLY | (6 << 8);
|
||||||
|
|
||||||
const SQLITE_ABORT_ROLLBACK: c_int = (super::SQLITE_ABORT | (2 << 8));
|
const SQLITE_ABORT_ROLLBACK: c_int = super::SQLITE_ABORT | (2 << 8);
|
||||||
|
|
||||||
const SQLITE_CONSTRAINT_CHECK: c_int = (super::SQLITE_CONSTRAINT | (1 << 8));
|
const SQLITE_CONSTRAINT_CHECK: c_int = super::SQLITE_CONSTRAINT | (1 << 8);
|
||||||
const SQLITE_CONSTRAINT_COMMITHOOK: c_int = (super::SQLITE_CONSTRAINT | (2 << 8));
|
const SQLITE_CONSTRAINT_COMMITHOOK: c_int = super::SQLITE_CONSTRAINT | (2 << 8);
|
||||||
const SQLITE_CONSTRAINT_FOREIGNKEY: c_int = (super::SQLITE_CONSTRAINT | (3 << 8));
|
const SQLITE_CONSTRAINT_FOREIGNKEY: c_int = super::SQLITE_CONSTRAINT | (3 << 8);
|
||||||
const SQLITE_CONSTRAINT_FUNCTION: c_int = (super::SQLITE_CONSTRAINT | (4 << 8));
|
const SQLITE_CONSTRAINT_FUNCTION: c_int = super::SQLITE_CONSTRAINT | (4 << 8);
|
||||||
const SQLITE_CONSTRAINT_NOTNULL: c_int = (super::SQLITE_CONSTRAINT | (5 << 8));
|
const SQLITE_CONSTRAINT_NOTNULL: c_int = super::SQLITE_CONSTRAINT | (5 << 8);
|
||||||
const SQLITE_CONSTRAINT_PRIMARYKEY: c_int = (super::SQLITE_CONSTRAINT | (6 << 8));
|
const SQLITE_CONSTRAINT_PRIMARYKEY: c_int = super::SQLITE_CONSTRAINT | (6 << 8);
|
||||||
const SQLITE_CONSTRAINT_TRIGGER: c_int = (super::SQLITE_CONSTRAINT | (7 << 8));
|
const SQLITE_CONSTRAINT_TRIGGER: c_int = super::SQLITE_CONSTRAINT | (7 << 8);
|
||||||
const SQLITE_CONSTRAINT_UNIQUE: c_int = (super::SQLITE_CONSTRAINT | (8 << 8));
|
const SQLITE_CONSTRAINT_UNIQUE: c_int = super::SQLITE_CONSTRAINT | (8 << 8);
|
||||||
const SQLITE_CONSTRAINT_VTAB: c_int = (super::SQLITE_CONSTRAINT | (9 << 8));
|
const SQLITE_CONSTRAINT_VTAB: c_int = super::SQLITE_CONSTRAINT | (9 << 8);
|
||||||
const SQLITE_CONSTRAINT_ROWID: c_int = (super::SQLITE_CONSTRAINT | (10 << 8));
|
const SQLITE_CONSTRAINT_ROWID: c_int = super::SQLITE_CONSTRAINT | (10 << 8);
|
||||||
const SQLITE_CONSTRAINT_PINNED: c_int = (super::SQLITE_CONSTRAINT | (11 << 8));
|
const SQLITE_CONSTRAINT_PINNED: c_int = super::SQLITE_CONSTRAINT | (11 << 8);
|
||||||
|
|
||||||
const SQLITE_NOTICE_RECOVER_WAL: c_int = (SQLITE_NOTICE | (1 << 8));
|
const SQLITE_NOTICE_RECOVER_WAL: c_int = SQLITE_NOTICE | (1 << 8);
|
||||||
const SQLITE_NOTICE_RECOVER_ROLLBACK: c_int = (SQLITE_NOTICE | (2 << 8));
|
const SQLITE_NOTICE_RECOVER_ROLLBACK: c_int = SQLITE_NOTICE | (2 << 8);
|
||||||
|
|
||||||
const SQLITE_WARNING_AUTOINDEX: c_int = (SQLITE_WARNING | (1 << 8));
|
const SQLITE_WARNING_AUTOINDEX: c_int = SQLITE_WARNING | (1 << 8);
|
||||||
|
|
||||||
const SQLITE_AUTH_USER: c_int = (super::SQLITE_AUTH | (1 << 8));
|
const SQLITE_AUTH_USER: c_int = super::SQLITE_AUTH | (1 << 8);
|
||||||
|
|
||||||
pub fn code_to_str(code: c_int) -> &'static str {
|
pub fn code_to_str(code: c_int) -> &'static str {
|
||||||
match code {
|
match code {
|
||||||
|
@ -749,6 +749,10 @@ impl Connection {
|
|||||||
///
|
///
|
||||||
/// The underlying SQLite database connection handle will not be closed when
|
/// The underlying SQLite database connection handle will not be closed when
|
||||||
/// the returned connection is dropped/closed.
|
/// the returned connection is dropped/closed.
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
///
|
||||||
|
/// This function is unsafe because improper use may impact the Connection.
|
||||||
pub unsafe fn from_handle(db: *mut ffi::sqlite3) -> Result<Connection> {
|
pub unsafe fn from_handle(db: *mut ffi::sqlite3) -> Result<Connection> {
|
||||||
let db_path = db_filename(db);
|
let db_path = db_filename(db);
|
||||||
let db = InnerConnection::new(db, false);
|
let db = InnerConnection::new(db, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user