mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-25 02:21:37 +08:00
Merge pull request #1301 from rusqlite/dependabot/cargo/bitflags-2.0
Update bitflags requirement from 1.2 to 2.0
This commit is contained in:
commit
32752fac77
@ -112,7 +112,7 @@ bundled-full = ["modern-full", "bundled"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
time = { version = "0.3.0", features = ["formatting", "macros", "parsing"], optional = true }
|
time = { version = "0.3.0", features = ["formatting", "macros", "parsing"], optional = true }
|
||||||
bitflags = "1.2"
|
bitflags = "2.0"
|
||||||
hashlink = "0.8"
|
hashlink = "0.8"
|
||||||
chrono = { version = "0.4", optional = true, default-features = false, features = ["clock"] }
|
chrono = { version = "0.4", optional = true, default-features = false, features = ["clock"] }
|
||||||
serde_json = { version = "1.0", optional = true }
|
serde_json = { version = "1.0", optional = true }
|
||||||
|
@ -69,13 +69,13 @@ impl InnerConnection {
|
|||||||
|
|
||||||
// Replicate the check for sane open flags from SQLite, because the check in
|
// Replicate the check for sane open flags from SQLite, because the check in
|
||||||
// SQLite itself wasn't added until version 3.7.3.
|
// SQLite itself wasn't added until version 3.7.3.
|
||||||
debug_assert_eq!(1 << OpenFlags::SQLITE_OPEN_READ_ONLY.bits, 0x02);
|
debug_assert_eq!(1 << OpenFlags::SQLITE_OPEN_READ_ONLY.bits(), 0x02);
|
||||||
debug_assert_eq!(1 << OpenFlags::SQLITE_OPEN_READ_WRITE.bits, 0x04);
|
debug_assert_eq!(1 << OpenFlags::SQLITE_OPEN_READ_WRITE.bits(), 0x04);
|
||||||
debug_assert_eq!(
|
debug_assert_eq!(
|
||||||
1 << (OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE).bits,
|
1 << (OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE).bits(),
|
||||||
0x40
|
0x40
|
||||||
);
|
);
|
||||||
if (1 << (flags.bits & 0x7)) & 0x46 == 0 {
|
if (1 << (flags.bits() & 0x7)) & 0x46 == 0 {
|
||||||
return Err(Error::SqliteFailure(
|
return Err(Error::SqliteFailure(
|
||||||
ffi::Error::new(ffi::SQLITE_MISUSE),
|
ffi::Error::new(ffi::SQLITE_MISUSE),
|
||||||
None,
|
None,
|
||||||
|
@ -1029,6 +1029,7 @@ bitflags::bitflags! {
|
|||||||
/// The default open flags are `SQLITE_OPEN_READ_WRITE | SQLITE_OPEN_CREATE
|
/// The default open flags are `SQLITE_OPEN_READ_WRITE | SQLITE_OPEN_CREATE
|
||||||
/// | SQLITE_OPEN_URI | SQLITE_OPEN_NO_MUTEX`. See [`Connection::open`] for
|
/// | SQLITE_OPEN_URI | SQLITE_OPEN_NO_MUTEX`. See [`Connection::open`] for
|
||||||
/// some discussion about these flags.
|
/// some discussion about these flags.
|
||||||
|
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct OpenFlags: ::std::os::raw::c_int {
|
pub struct OpenFlags: ::std::os::raw::c_int {
|
||||||
/// The database is opened in read-only mode.
|
/// The database is opened in read-only mode.
|
||||||
|
@ -28,6 +28,7 @@ const SERIES_COLUMN_STOP: c_int = 2;
|
|||||||
const SERIES_COLUMN_STEP: c_int = 3;
|
const SERIES_COLUMN_STEP: c_int = 3;
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
|
#[derive(Clone, Copy)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct QueryPlanFlags: ::std::os::raw::c_int {
|
struct QueryPlanFlags: ::std::os::raw::c_int {
|
||||||
// start = $value -- constraint exists
|
// start = $value -- constraint exists
|
||||||
@ -41,7 +42,7 @@ bitflags::bitflags! {
|
|||||||
// output in ascending order
|
// output in ascending order
|
||||||
const ASC = 16;
|
const ASC = 16;
|
||||||
// Both start and stop
|
// Both start and stop
|
||||||
const BOTH = QueryPlanFlags::START.bits | QueryPlanFlags::STOP.bits;
|
const BOTH = QueryPlanFlags::START.bits() | QueryPlanFlags::STOP.bits();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user