Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (13 sloc) 510 Bytes
use std::env;
use regex::Regex;
fn main() {
let multiplier = env::args().skip(1).next().expect("Please give multiplier as argument");
let multiplier: u64 = multiplier.parse().expect("Bad multiplier specified as argument");
let ones_and_zeroes = Regex::new(r"^[01]+$").unwrap();
.map(|num| num * multiplier)
.filter(|num| ones_and_zeroes.is_match(&num.to_string()))
You can’t perform that action at this time.