Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Apr 3, 2024
1 parent a39dc3b commit ebd8109
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion nostrdb
Submodule nostrdb updated 2 files
+1 −2 README.md
+1 −1 src/content_parser.c
5 changes: 5 additions & 0 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
}

Expand Down Expand Up @@ -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,
Expand All @@ -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 }
}
Expand Down Expand Up @@ -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 }
}
Expand Down
2 changes: 2 additions & 0 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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');
}
Expand Down
1 change: 1 addition & 0 deletions src/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down
1 change: 1 addition & 0 deletions src/test_util.rs
Original file line number Diff line number Diff line change
@@ -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"));
Expand Down

0 comments on commit ebd8109

Please sign in to comment.