nmuidi icon indicating copy to clipboard operation
nmuidi copied to clipboard

Idiomatic Rust and misc. updates

Open Riceman2000 opened this issue 1 year ago • 2 comments

There are a few things that I would like to change about the source code of this project to make it follow some of Rust's idioms.

  • Split the functional code into a Library Crate so it could be used by others
    • After this change consider uploading to crates.io
  • Error handling appropriate for a library using std::log -> https://docs.rs/log/latest/log/
    • Also critical errors should not panic, instead they should pass that error back
    • An error type for the library could be made to make this easier with thiserror https://docs.rs/thiserror/latest/thiserror/
  • Some unit testing
    • Incorporate testing into pipeline

Saw the YouTube video and I'd love to contribute, I'll submit a PR with a few changes.

Thanks!

Riceman2000 avatar Jan 22 '24 21:01 Riceman2000

Copying over from your PR #3 to track

Things still left to do if anyone is feeling up to it:

  • [ ] Add benchmarks
  • [ ] Benchmark across some different optimization settings
  • [ ] Write docs for the code -> https://doc.rust-lang.org/rust-by-example/meta/doc.html
  • [ ] Examples/doctests for those looking at is as a library
  • [ ] Decide the easiest way to execute this code

Currently I left it as use nmuidi::prelude::*; ... Cleaner::new("/test/path").clean() ... It could be simpler if we change some things around but that could close the door on other functionality 🤷

brasky avatar Feb 11 '24 23:02 brasky

Just published it as a crate https://crates.io/crates/nmuidi

brasky avatar Feb 12 '24 01:02 brasky