tiny-bip39 icon indicating copy to clipboard operation
tiny-bip39 copied to clipboard

C++ function wrapper

Open mullroy opened this issue 3 years ago • 1 comments

Good day, I've created C++ library access functions in lib.rs. The C++ header file and demo application is contained inside the C++ sub directory.

mullroy avatar Dec 23 '21 15:12 mullroy

Ahoy! I do not want to belay your efforts, but putting these functions and their imports into the lib.rs seems to be a bit intrusive to me. There are 2 ways to get it out from there:

  1. Create a module (say mod cpp) and extract them there.
  2. Create another crate that depends on this one and put it there.

The second has the advantage that build times do not increase for those who only use this crate from Rust. And has the disadvantage that it is difficult to notice your crate when someone only knows this one. Although I sometimes check the dependent crates of a crate to see how they are used: https://crates.io/crates/tiny-bip39/reverse_dependencies