maciejhirsz / tiny-bip39

A Rust implementation of BIP-0039
Apache License 2.0
65 stars 37 forks source link

C++ function wrapper #34

Open mullroy opened 2 years ago

mullroy commented 2 years ago

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.

wigy-opensource-developer commented 2 years ago

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