-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wavbrro improvements #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My approach to writing errors for applications is:
- do I need to handle different errors differently? If yes then use https://docs.rs/thiserror/latest/thiserror/
- if no, then use https://github.com/dtolnay/anyhow
When writing a library I should always use https://docs.rs/thiserror/latest/thiserror/
process_single_file(path, arguments)?; | ||
match process_single_file(path.clone(), arguments) { | ||
Ok (_) => continue, | ||
//TODO: Files are created while this walks the dir, gives a funny output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this means lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you walk a dir with std::fs::read_dir
it will call the underlying OS function, and if new files are created while you're walking the dir, they will be returned. Since the compressor is creating files, entry
will be one of the created files here and there, and there will be an output WARN/ERROR message.
A check has to be created for this case and ignore those files.
// Error class is based on https://codeberg.org/ruuda/hound/src/branch/master given the similarities | ||
// between the formats (WAV and WAVBRRO). | ||
#[derive(Debug)] | ||
pub enum Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.rs/thiserror/latest/thiserror/ can be helpful when writing error enums
After running a couple of tests and benchmarks, this PR uniforms error control in uncompressed vs compressed files.
WAVBRO now has a proper error type
And a misc change on FFT that has not much to do with anything but I landed it here.