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.
There is a problem here - it's verbose and prone to silent-ish breakage if the surrounding context changes due to e.g. refactors (well, probably not with this tiny example, but you probablu know what I mean). Thankfully, there is also a solution to this problem: https://github.com/rust-lang/rust/issues/90091
split_array will eventually allow something like the following, which avoids any explicit indexing and will fail to compile if the sizes don't match up:
struct IVec2(i32, i32);
[Clippy](https://github.com/rust-lang/rust-clippy) has a lint that will check for `.unwrap()` calls; [unwrap_used](https://rust-lang.github.io/rust-clippy/master/index.html#un...).
It is allowed by default, but you can turn it on in the configuration file.
Related posts
- Why is holding std sync locks across awaits not caught by the compiler?
- thread 'main' has overflowed its stack on Enum Match
- Is there ever a case you'd want to use &String::new() for something expecting &str?
- A Rust match made in hell
- Hey Rustaceans! Got an easy question? Ask here (32/2021)!