Skip to content

Instantly share code, notes, and snippets.

@mmstick

mmstick/main.rs Secret

Last active December 28, 2016 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmstick/a8316ba0514f9d9ab33b18fa9b916ca1 to your computer and use it in GitHub Desktop.
Save mmstick/a8316ba0514f9d9ab33b18fa9b916ca1 to your computer and use it in GitHub Desktop.
Simple line count
use std::io::{BufRead, BufReader};
use std::fs::File;
fn main() {
println!("{}", BufReader::with_capacity(8192, File::open("www.js").unwrap())
.lines().map(|x| x.unwrap()).filter(|x| x.contains("array")).count());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment