-
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.
let sets = [h_a, h_b, h_c]; // from https://github.com/rust-lang/rfcs/issues/2023 let intersection = sets .iter() .skip(1) .fold(sets[0].clone(), |acc, hs| { acc.intersection(hs).cloned().collect() });
While an experienced programmer, I'm just starting to learn Rust by doing this year's Advent of Code in it. For today's problem Day 03 , I needed to find the intersection of three sets of characters. Using HashSet, I'd expected to be able to do something along the lines of this:
My final version is here if anyone wants some more context, though please limit any feedback to this particular operation (I've got a lot of learning to go). Looking at other's solutions, everyone appeared to either go to chained functional calls like the above (fold, map, filter, etc.) or just implementing intersection from scratch. While I appreciate the elegance of the former approach, I find it, regardless of the language, pretty opaque.