Skip to content

Commit

Permalink
Add note builder api
Browse files Browse the repository at this point in the history
Fixes: #10
Changelog-Fixed: Fixed double-free issue for owned notes
Changelog-Added: Added note builder interface
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Jun 28, 2024
1 parent 31ea02a commit dd397de
Show file tree
Hide file tree
Showing 6 changed files with 349 additions and 30 deletions.
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
mkShell {
nativeBuildInputs = [ rustPlatform.bindgenHook cargo clippy rustc rustfmt libiconv pkg-config valgrind ];
nativeBuildInputs = [ rustPlatform.bindgenHook cargo clippy rustc rustfmt libiconv pkg-config valgrind gdb ];

LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use filter::Filter;
pub use ndb::Ndb;
pub use ndb_profile::{NdbProfile, NdbProfileRecord};
pub use ndb_str::{NdbStr, NdbStrVariant};
pub use note::{Note, NoteKey};
pub use note::{Note, NoteBuildOptions, NoteBuilder, NoteKey};
pub use profile::{ProfileKey, ProfileRecord};
pub use query::QueryResult;
pub use result::Result;
Expand Down
4 changes: 2 additions & 2 deletions src/ndb_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{bindings, Note};

pub struct NdbStr<'a> {
ndb_str: bindings::ndb_str,
note: Note<'a>,
note: &'a Note<'a>,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -42,7 +42,7 @@ impl<'a> NdbStr<'a> {
&self.note
}

pub(crate) fn new(ndb_str: bindings::ndb_str, note: Note<'a>) -> Self {
pub(crate) fn new(ndb_str: bindings::ndb_str, note: &'a Note<'a>) -> Self {
NdbStr { ndb_str, note }
}

Expand Down
Loading

0 comments on commit dd397de

Please sign in to comment.