commit ebd8109ec7f5081bf30982fd83d30f9c61435ac5
parent a39dc3bb0195208e444aff71350bca241dfc6e68
Author: William Casarin <jb55@jb55.com>
Date: Wed, 3 Apr 2024 12:35:52 -0700
fix warnings
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
5 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/build.rs b/build.rs
@@ -77,8 +77,10 @@ fn main() {
.include("nostrdb/deps/secp256k1/include")
// Add other include paths
//.flag("-Wall")
+ .flag("-Wno-sign-compare")
.flag("-Wno-misleading-indentation")
- .flag("-Wno-unused-function");
+ .flag("-Wno-unused-function")
+ .flag("-Wno-unused-parameter");
//.flag("-Werror")
//.flag("-g")
diff --git a/src/block.rs b/src/block.rs
@@ -9,6 +9,8 @@ pub struct Blocks<'a> {
#[derive(Debug)]
pub struct Block<'a> {
ptr: *mut bindings::ndb_block,
+
+ #[allow(dead_code)]
txn: Option<&'a Transaction>,
}
@@ -130,6 +132,7 @@ impl Bech32Type {
}
impl<'a> Block<'a> {
+ #[allow(dead_code)]
pub(crate) fn new_transactional(
ptr: *mut bindings::ndb_block,
txn: &'a Transaction,
@@ -140,6 +143,7 @@ impl<'a> Block<'a> {
}
}
+ #[allow(dead_code)]
pub(crate) fn new_owned(ptr: *mut bindings::ndb_block) -> Block<'static> {
Block { ptr, txn: None }
}
@@ -199,6 +203,7 @@ impl<'a> Blocks<'a> {
}
}
+ #[allow(dead_code)]
pub(crate) fn new_owned(ptr: *mut bindings::ndb_blocks) -> Blocks<'static> {
Blocks { ptr, txn: None }
}
diff --git a/src/filter.rs b/src/filter.rs
@@ -142,6 +142,7 @@ impl FilterBuilder {
self.start_field(bindings::ndb_filter_fieldtype_NDB_FILTER_SINCE);
}
+ #[allow(dead_code)]
fn start_limit_field(&mut self) {
self.start_field(bindings::ndb_filter_fieldtype_NDB_FILTER_LIMIT);
}
@@ -150,6 +151,7 @@ impl FilterBuilder {
self.start_field(bindings::ndb_filter_fieldtype_NDB_FILTER_IDS);
}
+ #[allow(dead_code)]
fn start_events_field(&mut self) {
self.start_tags_field('e');
}
diff --git a/src/note.rs b/src/note.rs
@@ -44,6 +44,7 @@ impl<'a> Note<'a> {
/// use this method directly, public consumer would use from_json instead.
///
/// [Drop]: std::ops::Drop
+ #[allow(dead_code)]
pub(crate) fn new_owned(ptr: *mut bindings::ndb_note, size: usize) -> Note<'static> {
Note::Owned { ptr, size }
}
diff --git a/src/test_util.rs b/src/test_util.rs
@@ -1,6 +1,7 @@
use std::fs;
use std::path::Path;
+#[allow(dead_code)]
pub fn cleanup_db(path: &str) {
let p = Path::new(path);
let _ = fs::remove_file(p.join("data.mdb"));