I would like to assign a value to a slice a[start..end] (suppose a: &mut Vec<usize>), and of course a traditional for can meet this requirement:
for i in start..end {
a[i] = value;
}
I also tried a[start..end].copy_from_slice(&vec![value; end - start]), but clearly it is much slower.
I would like to know whether there is an idiomatic way to do so in Rust.