Skip to content

Commit c3c3081

Browse files
committed
cargo fmt --all
1 parent dba837b commit c3c3081

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

src/backend/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl InstallationState {
253253
fn setup_system(&self, output: RepartOutput, passphrase: Option<&str>) -> Result<()> {
254254
// XXX: This is a bit hacky, but this function should be called before output.generate_fstab() for
255255
// the fstab generator to be correct, IF we're using encryption
256-
//
256+
//
257257
// todo: Unfuck this
258258
let mut container = output.to_container(passphrase)?;
259259

src/backend/postinstall/cryptsetup.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct CryptSetup;
1010
impl PostInstallModule for CryptSetup {
1111
fn run(&self, context: &Context) -> Result<()> {
1212
let mut f = std::fs::File::create("/etc/crypttab")?;
13-
13+
1414
f.write_all(b"# This file is generated by Readymade.\n")?;
1515
// need to get partition list???
1616

src/backend/postinstall/grub2.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,20 @@ impl PostInstallModule for GRUB2 {
127127
fn run(&self, context: &Context) -> Result<()> {
128128
stage!("Generating system grub defaults" {
129129
let mut defaults = Grub2Defaults::default();
130-
130+
131131
// Now, let's add extra boot opts if they exist
132132
if let Some(crypt_data) = &context.crypt_data {
133133
// prepend
134134
let current_value = defaults.cmdline_linux.clone();
135-
135+
136136
// this is a mess.
137137
// todo: In the event someone thinks this code stinks, please please PLEASE refactor it for us.
138-
138+
139139
let joined_cmdline = crypt_data.cmdline_opts.join(" ");
140140
tracing::info!("Adding cryptsetup cmdline options: {}", joined_cmdline);
141141
defaults.cmdline_linux = format!("{} {}", joined_cmdline, current_value);
142142
}
143-
143+
144144
let defaults_str = defaults.generate();
145145
std::fs::write("/etc/default/grub", defaults_str)?;
146146
});

src/backend/postinstall/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use std::path::PathBuf;
1616
use super::repart_output::CryptData;
1717

1818
pub mod cleanup_boot;
19+
pub mod cryptsetup;
1920
pub mod dracut;
2021
pub mod efi_stub;
2122
pub mod grub2;
@@ -24,7 +25,6 @@ pub mod language;
2425
pub mod prepare_fedora;
2526
pub mod reinstall_kernel;
2627
pub mod selinux;
27-
pub mod cryptsetup;
2828

2929
pub struct Context {
3030
pub destination_disk: PathBuf,

src/backend/repart_output.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl MapperCache {
5555
fn insert(&mut self, node: String, path: PathBuf) {
5656
self.cache.insert(node, path);
5757
}
58-
58+
5959
fn clear(&mut self) {
6060
for (node, path) in self.cache.drain() {
6161
if let Err(e) = cryptsetup_close(&path.to_string_lossy()) {
@@ -431,19 +431,19 @@ impl RepartPartition {
431431
// - Finding the UUID of the mapper device by doing some symlink magic (thanks udev!)
432432
// - Using that UUID for the fstab entry
433433

434-
435434
// We're gonna be abusing the mapper cache, which should be populated by the time we get here
436-
435+
437436
let mapper_cache = MAPPER_CACHE.read().unwrap();
438437
let mapper_path = mapper_cache.get(&self.node).unwrap();
439-
440438

441439
tracing::trace!(?mapper_path, "Guessed mapper path as this");
442440

443441
// Thankfully, since we made lsblk-rs we can do this easily.
444442
let device = lsblk::BlockDevice::from_path(&mapper_path)?;
445443
tracing::trace!(?device, "Found device from mapper path");
446-
let uuid = device.uuid.ok_or_eyre("Could not find UUID of decrypted device")?;
444+
let uuid = device
445+
.uuid
446+
.ok_or_eyre("Could not find UUID of decrypted device")?;
447447

448448
// The mapper path should be a symlink to the /dev/dm-XX device
449449

src/backend/repartcfg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,4 +411,4 @@ impl EncryptOption {
411411
pub const fn is_on(self) -> bool {
412412
!matches!(self, EncryptOption::Off)
413413
}
414-
}
414+
}

src/main.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ fn main() -> Result<()> {
213213

214214
IPC_CHANNEL.set(Mutex::new(channel)).unwrap();
215215
let install_state: InstallationState = serde_json::from_reader(std::io::stdin())?;
216-
217-
218216

219217
return install_state.install();
220218
}
@@ -268,9 +266,9 @@ fn setup_hooks() -> impl std::any::Any {
268266
std::env::set_var(key, value);
269267
}
270268
}
271-
269+
272270
let is_non_interactive = std::env::args().any(|arg| arg == "--non-interactive");
273-
271+
274272
let readymade_log_file = if !is_non_interactive {
275273
"readymade.log"
276274
} else {

0 commit comments

Comments
 (0)