Our great sponsors
-
chalk
An implementation and definition of the Rust trait system using a PROLOG-like logic solver (by rust-lang)
-
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.
For me an attempt to write where HashMap: FromIterator and then use new and insert was totally bizzare because currently rustc is pretty primitive and doesn't do super-complex machinery needed to do what you want. Chalk may fix that one day, but it's nowhere near to being ready for inclusion into rustc thus I wouldn't even attempt to do what you tried to do… but that's not something you are supposed to know before reading this book!
I actually hope in 2nd edition /u/Jonhoo would dedicate a separate page or two for this issue. I mean: when I first saw how you can replace where BufReader: ReadNumeric + ReadNumeric into here BufReader: ReadNumeric + ReadNumeric and turn code which fails to compile into something that actually does compile… I was kinda… WTH? Isn't where A: X + Y and where A: Y + X always mean the same thing? Yet, apparently, for an existing compiler the answer is “no” (and it's not trivial to fix).