Q:

How to convert a mutating loop into functional style? 

I want to implement an array with 256 random numbers and the numbers must be a value between 0 and 1 inclusively. 
This code works, but I would like to make it more functional.  How can I convert section 2 into a functional style and chain it with the expression in section 1?  
let t: f64 = 1.0;
let n = 256;
let dt: f64 = t / n as f64;

let mut numbers = Vec::<f64>::with_capacity(n);
let mut rng = rand::thread_rng();

// section 1
numbers = iter::repeat(())
    .map(|()| rng.gen_range(0.,  1.)) 
    .take(n)
    .collect::<Vec<f64>>();

// section 2  
for i in 0 .. n {
    numbers[i] = numbers[i] * dt.sqrt();
}

A:

Converting section 2 is just a simple map:
numbers = numbers.into_iter()
    .map(|x| x * dt.sqrt())
    .collect::<Vec<_>>();

To combine, just throw in the map at some point: 
numbers = iter::repeat(())
    .map(|()| rng.gen_range(0.,  1.)) 
    .map(|x| x * dt.sqrt())
    .take(N)
    .collect::<Vec<f64>>();

Or if you prefer:
numbers = iter::repeat(())
    .map(|()| rng.gen_range(0.,  1.) *  dt.sqrt())
    .take(N)
    .collect::<Vec<f64>>();

