config.hdsize = zfs.disk_size;
config.zfs_opts = Some(zfs.clone().into());
- let mut i = 0;
- for disk in &options.bootdisk.disks {
+ for (i, disk) in options.bootdisk.disks.iter().enumerate() {
config
.disk_selection
.insert(i.to_string(), disk.index.clone());
- i = i + 1;
}
}
AdvancedBootdiskOptions::Btrfs(btrfs) => {
config.hdsize = btrfs.disk_size;
- let mut i = 0;
- for disk in &options.bootdisk.disks {
+ for (i, disk) in options.bootdisk.disks.iter().enumerate() {
config
.disk_selection
.insert(i.to_string(), disk.index.clone());
- i = i + 1;
}
}
}
}
impl<T: View> MultiDiskOptionsView<T> {
- fn new(avail_disks: &[Disk], selected_disks: &Vec<usize>, options_view: T) -> Self {
+ fn new(avail_disks: &[Disk], selected_disks: &[usize], options_view: T) -> Self {
let mut selectable_disks = avail_disks
.iter()
.map(|d| (d.to_string(), Some(d.clone())))
selectable_disks.push(("-- do not use --".to_owned(), None));
let mut disk_form = FormView::new();
- for i in 0..avail_disks.len() {
+ for (i, _) in avail_disks.iter().enumerate() {
disk_form.add_child(
&format!("Harddisk {i}"),
SelectView::new()