From 30a88572b7af263ed4931b5b5ce1639eab4fbfb0 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 5 Oct 2022 14:30:56 +0200 Subject: [PATCH] Fix clippy warnings --- src/lib.rs | 2 +- src/tasks/mod.rs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 32a37aa..2a3c757 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,7 +58,7 @@ impl TaskExecutor { /// Installs the system from the given system configuration #[tracing::instrument(level = "trace", skip(self))] pub async fn install_from_config(&self) -> AppResult<()> { - let config = self.config.clone().ok_or_else(|| AppError::MissingConfig)?; + let config = self.config.clone().ok_or(AppError::MissingConfig)?; self.create_partitions(config.partitions).await?; self.install_base(()).await?; self.install_kernels(config.kernels).await?; diff --git a/src/tasks/mod.rs b/src/tasks/mod.rs index 4751943..2c01420 100644 --- a/src/tasks/mod.rs +++ b/src/tasks/mod.rs @@ -55,16 +55,13 @@ impl TaskFiles { macro_rules! __all_tasks { ($($task:ident),+) => { { - let mut list = Vec::new(); - $( - list.push(TaskFiles { + vec![$( + TaskFiles { script: $task::get_name().into(), pre_hook: $task::get_pre_hook().into(), post_hook: $task::get_post_hook().into(), - }); - )+ - - list + }, + )+] } }; }