fix: update bindgen in libmdbx-rs (#2703)

This commit is contained in:
Dan Cline
2023-05-16 21:21:02 -04:00
committed by GitHub
parent 9b79218c18
commit ca6724f106
4 changed files with 120 additions and 66 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "reth-mdbx-sys"
version = "0.12.1-0"
version = "0.12.6-0"
edition = "2021"
license = "Apache-2.0"
description = "Rust bindings for libmdbx with good licence."
@ -15,4 +15,4 @@ libc = "0.2"
[build-dependencies]
cc = "1.0"
bindgen = { version = "0.61", default-features = false, features = ["runtime"] }
bindgen = { version = "0.65", default-features = false, features = ["runtime"] }

View File

@ -1,4 +1,7 @@
use bindgen::callbacks::{IntKind, ParseCallbacks};
use bindgen::{
callbacks::{IntKind, ParseCallbacks},
Formatter,
};
use std::{env, path::PathBuf};
#[derive(Debug)]
@ -66,7 +69,7 @@ fn main() {
.prepend_enum_name(false)
.generate_comments(false)
.disable_header_comment()
.rustfmt_bindings(true)
.formatter(Formatter::Rustfmt)
.generate()
.expect("Unable to generate bindings");

View File

@ -42,10 +42,7 @@ impl<'tx> TableObject<'tx> for Cow<'tx, [u8]> {
#[cfg(not(feature = "return-borrowed"))]
{
let is_dirty = (!K::ONLY_CLEAN) &&
crate::error::mdbx_result::mdbx_result(ffi::mdbx_is_dirty(
_txn,
data_val.iov_base,
))?;
crate::error::mdbx_result(ffi::mdbx_is_dirty(_txn, data_val.iov_base))?;
Ok(if is_dirty { Cow::Owned(s.to_vec()) } else { Cow::Borrowed(s) })
}