@codesections Honestly more surprised you ran into ..= syntax faster! Did you get it from clippy or just learn it from elsewhere?
@Eden I think I came across the `..=` syntax in a discussion of whether `0..=n` is as fast as `0..n + 1` (tl;dr;, no because it makes a couple extra checks regarding overflow that result in extra assembly instructions).
My one biggest complaint with the Rust book, by the way, is that it makes it surprisingly easy to miss little bits of syntax like this—but maybe that's just from comparing Rust to languages that don't *have* as much syntax.
@codesections That is really interesting.
Yeah! I missed loads from the rust book - big ones being how to use where for generics. Originally I saw where as restrictive, and now I see it as hugely powerful.
Do definitely play with clippy though - it's in rustup as a component, and it'll catch things like ..(n+1) and offer better syntax
@codesections @Eden .. vs ..= stood out pretty clearly to me when I read the book. It's right there in the first section about slices: https://doc.rust-lang.org/book/ch04-03-slices.html#string-slices
Coming from Python I'm all about slices and range operators though, so I tend to focus on those aspects of any new language I try.
@codesections Oh I shouldn't have gone into the history of the turbofish syntax, the guy using it for the first time has cancer and now I'm sad
@Matter Oh that is sad
@codesections I love these little pieces of internet lore...
@codesections Nice! Until now I didn't know about `..=`!
Fosstodon is a Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.