RustAudio / lewton

Rust vorbis decoder
Other
261 stars 26 forks source link

Update all code to Edition 2018 #83

Closed rawler closed 4 years ago

rawler commented 4 years ago

I would like to run cargo fmt as well, but my version of rustfmt complains loudly on .rustfmt.toml. Ok to remove, and just adhere to "normal" Rust styling?

est31 commented 4 years ago

Thanks for the PR, but I'm afraid that edition 2018 makes the developer experience for lewton worse. The reason is as follows: The ? operator does not support backtraces. Backtraces are still unstable, as is the Try trait. In the early days of lewton I was debugging it a lot. Back then it was extremely helpful to quickly know the origin of an error, the precise line of it. The alternatives like anyhow are nice but they are heavy (extra dependency). I'll wait a bit until the post-try! world matures.

As for cargo fmt, sadly rustfmt is still not mature enough to support the coding style I desire to use. That's why I won't use it for now in lewton. I'm wondering though about either forking it, or maybe building my own formatter from scratch.

Thank you for your understanding.

rawler commented 4 years ago

Ahh, understandable, but also too bad. I would like to use the header-parsing code (that setup header is a BEAST), but not the decoding code (the use case is for repackaging without re-encode) and was hoping to let my client sponsor some open-source development.

Would you be open to some specific feature-requests of the API instead?

est31 commented 4 years ago

Yes, absolutely. Please don't be discouraged by me closing this PR!

TonalidadeHidrica commented 3 years ago

@est31 Can't we still update it to Rust 2018 while keeping the capability of obtaining backtrace, as long as we stick to the original try! macro instead of replacing them to ? operator? (The name try! should be renamed in such case)