mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-25 22:49:28 +02:00
Make clippy happy
This commit is contained in:
parent
c04b5f5559
commit
b3449b6b3d
@ -225,7 +225,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
||||
|
||||
packages.extend(presets.packages);
|
||||
|
||||
if presets.aur_packages.len() > 0 {
|
||||
if !presets.aur_packages.is_empty() {
|
||||
packages.extend(constants::AUR_DEPENDENCIES.iter().map(|s| String::from(*s)));
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
||||
);
|
||||
debug!("fstab:\n{}", fstab);
|
||||
fs::write(mount_point.path().join("etc/fstab"), fstab).context("fstab error")?;
|
||||
if presets.aur_packages.len() > 0 {
|
||||
if !presets.aur_packages.is_empty() {
|
||||
arch_chroot
|
||||
.execute()
|
||||
.arg(mount_point.path())
|
||||
|
@ -22,10 +22,8 @@ fn visit_dirs(dir: &Path, filevec: &mut Vec<PathBuf>) -> Result<(), io::Error> {
|
||||
let path = entry.path();
|
||||
if path.is_dir() {
|
||||
visit_dirs(&path, filevec)?;
|
||||
} else {
|
||||
if entry.path().extension() == Some(&std::ffi::OsString::from("toml")) {
|
||||
filevec.push(entry.path());
|
||||
}
|
||||
} else if entry.path().extension() == Some(&std::ffi::OsString::from("toml")) {
|
||||
filevec.push(entry.path());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ impl CommandExt for Command {
|
||||
let exit_status = self.spawn()?.wait()?;
|
||||
|
||||
if !exit_status.success() {
|
||||
Err(anyhow!("Bad exit code: {}", exit_status))?;
|
||||
return Err(anyhow!("Bad exit code: {}", exit_status));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@ -25,7 +25,7 @@ impl CommandExt for Command {
|
||||
if !output.status.success() {
|
||||
let error = str::from_utf8(&output.stderr).unwrap_or("[INVALID UTF8]");
|
||||
error!("{}", error);
|
||||
Err(anyhow!("Bad exit code: {}", output.status))?;
|
||||
return Err(anyhow!("Bad exit code: {}", output.status));
|
||||
}
|
||||
|
||||
Ok(String::from(str::from_utf8(&output.stdout).map_err(
|
||||
|
Loading…
x
Reference in New Issue
Block a user