inject_file_to_iso(&tmp_iso, &instmode_file_tmp, "/auto-installer-mode.toml")?;
if let Some(answer_file) = &args.answer_file {
- inject_file_to_iso(&tmp_iso, &answer_file, "/answer.toml")?;
+ inject_file_to_iso(&tmp_iso, answer_file, "/answer.toml")?;
}
println!("Moving prepared ISO to target location...");
lvm_checks(&source)?;
(
FsType::Xfs,
- FsOptions::LVM(source.lvm.unwrap_or(LvmOptions::default())),
+ FsOptions::LVM(source.lvm.unwrap_or_default()),
)
}
Filesystem::Ext4 => {
lvm_checks(&source)?;
(
FsType::Ext4,
- FsOptions::LVM(source.lvm.unwrap_or(LvmOptions::default())),
+ FsOptions::LVM(source.lvm.unwrap_or_default()),
)
}
Filesystem::Zfs => {
.expect("could not get LOGFILE")
.lock()
.expect("could not get mutex for LOGFILE");
- write!(file, "{}: {}\n", record.level(), record.args())
+ writeln!(file, "{}: {}", record.level(), record.args())
.expect("could not write to LOGFILE");
}
}
.join("tests/resources"))
}
fn get_answer(path: PathBuf) -> Result<Answer, String> {
- let answer_raw = std::fs::read_to_string(&path).unwrap();
+ let answer_raw = std::fs::read_to_string(path).unwrap();
let answer: answer::Answer = toml::from_str(&answer_raw)
.map_err(|err| format!("error parsing answer.toml: {err}"))
.unwrap();
}
AutoInstModes::Included => {
let answer_path = PathBuf::from("/cdrom/answer.toml");
- match fs::read_to_string(&answer_path) {
+ match fs::read_to_string(answer_path) {
Ok(answer) => return Ok(answer),
Err(err) => info!("Fetching answer file from ISO failed: {err}"),
}
println!("{answer}");
- return ExitCode::SUCCESS;
+ ExitCode::SUCCESS
}
let timezone = locales
.cczones
.get(&country)
- .and_then(|zones| zones.get(0))
+ .and_then(|zones| zones.first())
.cloned()
.unwrap_or_else(|| "UTC".to_owned());
}
impl NetworkOptions {
- const DEFAULT_DOMAIN: &str = "example.invalid";
+ const DEFAULT_DOMAIN: &'static str = "example.invalid";
pub fn defaults_from(setup: &SetupInfo, network: &NetworkInfo) -> Self {
let mut this = Self {