Our great sponsors
-
Clippy
A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
rust-analyzer
Discontinued A Rust compiler front-end for IDEs [Moved to: https://github.com/rust-lang/rust-analyzer] (by rust-analyzer)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Btw, using .expect() with a dynamically-formatted error message is a bit wasteful, because even if the file was read correctly, format!() will still be executed just to be thrown away a moment later (clippy even has a warning for that).
Oh, thanks! I had installed the Rust extension in VS Code since it looked more "official"; I installed rust-analyzer instead and problem solved. Thanks!
I don't know why he's doing it like this. I thought it might have something to do with the example being around 2 years old, dating back to version 0.14 of the rusqlite crate, but that does not seem to be the case. It could be as simple as the author just not noticing it wasn't required.
you need to use a "loopback" device, as shown here - https://github.com/RustAudio/cpal/pull/478 (note, ive only tested this on windows - if its not supported on linux you could always plug your sound card output into its line-in/mic jack)
There is a CLI application I'm working on that contains a code like this for returning custom exit codes:
I made one now in case there is an interest https://github.com/ducaale/exit_status