mirror of
https://github.com/isar/rusqlite.git
synced 2025-01-20 03:30:51 +08:00
Fix build on some older versions of Rust
This commit is contained in:
parent
ca7a28b442
commit
cdce75328e
@ -377,7 +377,10 @@ mod bindings {
|
|||||||
fn generating_bundled_bindings() -> bool {
|
fn generating_bundled_bindings() -> bool {
|
||||||
// Hacky way to know if we're generating the bundled bindings
|
// Hacky way to know if we're generating the bundled bindings
|
||||||
println!("cargo:rerun-if-env-changed=LIBSQLITE3_SYS_BUNDLING");
|
println!("cargo:rerun-if-env-changed=LIBSQLITE3_SYS_BUNDLING");
|
||||||
matches!(std::env::var("LIBSQLITE3_SYS_BUNDLING"), Ok(v) if v != "0")
|
match std::env::var("LIBSQLITE3_SYS_BUNDLING") {
|
||||||
|
Ok(v) => v != "0",
|
||||||
|
Err(_) => false,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_to_out_dir(header: HeaderLocation, out_path: &Path) {
|
pub fn write_to_out_dir(header: HeaderLocation, out_path: &Path) {
|
||||||
|
@ -261,7 +261,7 @@ impl InnerConnection {
|
|||||||
let tail = if c_tail.is_null() {
|
let tail = if c_tail.is_null() {
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
let n = unsafe { c_tail.offset_from(c_sql) };
|
let n = (c_tail as isize) - (c_sql as isize);
|
||||||
if n <= 0 || n >= len as isize {
|
if n <= 0 || n >= len as isize {
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
|
@ -136,7 +136,7 @@ impl FromSql for f64 {
|
|||||||
impl FromSql for bool {
|
impl FromSql for bool {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
|
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
|
||||||
i64::column_result(value).map(|i| !matches!(i, 0))
|
i64::column_result(value).map(|i| i != 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,6 +185,7 @@ impl SeriesTabCursor<'_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[allow(clippy::comparison_chain)]
|
||||||
unsafe impl VTabCursor for SeriesTabCursor<'_> {
|
unsafe impl VTabCursor for SeriesTabCursor<'_> {
|
||||||
fn filter(&mut self, idx_num: c_int, _idx_str: Option<&str>, args: &Values<'_>) -> Result<()> {
|
fn filter(&mut self, idx_num: c_int, _idx_str: Option<&str>, args: &Values<'_>) -> Result<()> {
|
||||||
let mut idx_num = QueryPlanFlags::from_bits_truncate(idx_num);
|
let mut idx_num = QueryPlanFlags::from_bits_truncate(idx_num);
|
||||||
@ -203,7 +204,6 @@ unsafe impl VTabCursor for SeriesTabCursor<'_> {
|
|||||||
}
|
}
|
||||||
if idx_num.contains(QueryPlanFlags::STEP) {
|
if idx_num.contains(QueryPlanFlags::STEP) {
|
||||||
self.step = args.get(i)?;
|
self.step = args.get(i)?;
|
||||||
#[allow(clippy::comparison_chain)]
|
|
||||||
if self.step == 0 {
|
if self.step == 0 {
|
||||||
self.step = 1;
|
self.step = 1;
|
||||||
} else if self.step < 0 {
|
} else if self.step < 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user