#![feature(core)]
#[macro_use] extern crate libeuler;

use libeuler::traits::DigitsHelper;
use std::iter::range_inclusive;

/// It can be seen that the number, 125874, and its double, 251748, contain exactly the same
/// digits, but in a different order.
///
/// Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same
/// digits.
fn main() {
    solutions! {
        sol naive {
            for i in 1.. {
                if range_inclusive(2, 6).all(|d| i.is_permutation_of(&(i*d))) {
                    return i
                }
            }

            unreachable!();
        }
    }
}

#[macro_use] extern crate libeuler;

use libeuler::traits::DigitsHelper;

/// It can be seen that the number, 125874, and its double, 251748, contain exactly the same
/// digits, but in a different order.
///
/// Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same
/// digits.
fn main() {
    solutions! {
        sol naive {
            for i in 1.. {
                if (2..7).all(|d| i.is_permutation_of(&(i*d))) {
                    return i
                }
            }

            unreachable!();
        }
    }
}

--- 
+++ 
@@ -1,6 +1,8 @@
+#![feature(core)]
 #[macro_use] extern crate libeuler;
 
 use libeuler::traits::DigitsHelper;
+use std::iter::range_inclusive;
 
 /// It can be seen that the number, 125874, and its double, 251748, contain exactly the same
 /// digits, but in a different order.
@@ -11,7 +13,7 @@
     solutions! {
         sol naive {
             for i in 1.. {
-                if (2..7).all(|d| i.is_permutation_of(&(i*d))) {
+                if range_inclusive(2, 6).all(|d| i.is_permutation_of(&(i*d))) {
                     return i
                 }
             }
Use range_inclusive in problem 52
