News for hackers. Stuff that matters.
Re:The Path to Rust by arielb1 on Thursday May 26, 2016 @04:27AM (#11776468)
That part is certainly extreme because of ownership. It can be refactored to

        let mut words = HashSet::new();
        for line in file.lines() {
            let line_words = line.unwrap().split_whitespace();
            words.extend(
                line_words.map(|s| s.to_string())
            );
        }
        words.into_iter().map(move |word| (word, f))

There are no comments on this comment yet.