Skip to content

Commit dd397de

Browse files
committed
Add note builder api
Fixes: #10 Changelog-Fixed: Fixed double-free issue for owned notes Changelog-Added: Added note builder interface Signed-off-by: William Casarin <[email protected]>
1 parent 31ea02a commit dd397de

File tree

6 files changed

+349
-30
lines changed

6 files changed

+349
-30
lines changed

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ pkgs ? import <nixpkgs> {} }:
22
with pkgs;
33
mkShell {
4-
nativeBuildInputs = [ rustPlatform.bindgenHook cargo clippy rustc rustfmt libiconv pkg-config valgrind ];
4+
nativeBuildInputs = [ rustPlatform.bindgenHook cargo clippy rustc rustfmt libiconv pkg-config valgrind gdb ];
55

66
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
77
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub use filter::Filter;
3333
pub use ndb::Ndb;
3434
pub use ndb_profile::{NdbProfile, NdbProfileRecord};
3535
pub use ndb_str::{NdbStr, NdbStrVariant};
36-
pub use note::{Note, NoteKey};
36+
pub use note::{Note, NoteBuildOptions, NoteBuilder, NoteKey};
3737
pub use profile::{ProfileKey, ProfileRecord};
3838
pub use query::QueryResult;
3939
pub use result::Result;

src/ndb_str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{bindings, Note};
22

33
pub struct NdbStr<'a> {
44
ndb_str: bindings::ndb_str,
5-
note: Note<'a>,
5+
note: &'a Note<'a>,
66
}
77

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

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

0 commit comments

Comments
 (0)