Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
style: apply cargo fmt and cargo clippy suggest
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish committed Feb 11, 2024
1 parent aa420cc commit 1097009
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions src/disks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ If you want to do this, change your computer's boot mode to UEFI mode."#
let device = &mut device as *mut Device;
let device = unsafe { &mut (*device) };

let start_sector = 1024 * 1024 / sector_size;
let start_sector = 1024 * 1024 / sector_size;

let system_end_sector = if is_efi {
length - efi_size / sector_size + start_sector
Expand All @@ -457,7 +457,7 @@ If you want to do this, change your computer's boot mode to UEFI mode."#
file_system: Some(FileSystem::Ext4),
kind: PartitionType::Primary,
flags,
label: None,
label: None,
};

create_partition(device, system)?;
Expand Down Expand Up @@ -498,7 +498,7 @@ If you want to do this, change your computer's boot mode to UEFI mode."#
let device = unsafe { &mut (*device) };

create_partition(device, efi)?;

let p = Partition {
path: Some(PathBuf::from("/dev/loop30p2")),
parent_path: Some(dev.to_path_buf()),
Expand Down Expand Up @@ -608,7 +608,7 @@ If you want to do this, change your computer's boot mode to UEFI mode."#
let mut device = unsafe { &mut (*device) };

let start_sector = 1024 * 1024 / sector_size;
let end_sector = start_sector + (512 * 1024 * 1024 / device.sector_size());
let end_sector = start_sector + (512 * 1024 * 1024 / device.sector_size());

if is_efi {
let efi = &PartitionCreate {
Expand All @@ -628,11 +628,7 @@ If you want to do this, change your computer's boot mode to UEFI mode."#
create_partition(&mut device, efi)?;
}

let system_start_sector = if is_efi {
end_sector
} else {
start_sector
};
let system_start_sector = if is_efi { end_sector } else { start_sector };

let mut flags = vec![];

Expand Down
2 changes: 1 addition & 1 deletion src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ pub fn genfstab_to_file(partition: &Partition, root_path: &Path, mount_path: &Pa
})?;
let s = fstab_entries(partition.path.as_ref(), fs_type, Some(mount_path))?;
let mut f = std::fs::OpenOptions::new()
.write(true)

.append(true)
.open(root_path.join("etc/fstab"))?;
f.write_all(s.as_bytes())?;
Expand Down

0 comments on commit 1097009

Please sign in to comment.