From 3e461dec1c0655599a0f6383ddbf136f53e55f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 20 Jan 2021 17:23:52 +0100 Subject: [PATCH] apt: let api handle optional bool with default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit one less FIXME :) Signed-off-by: Fabian Grünbichler Signed-off-by: Wolfgang Bumiller --- src/api2/node/apt.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/api2/node/apt.rs b/src/api2/node/apt.rs index 52eeb976..9d723f17 100644 --- a/src/api2/node/apt.rs +++ b/src/api2/node/apt.rs @@ -107,16 +107,13 @@ fn do_apt_update(worker: &WorkerTask, quiet: bool) -> Result<(), Error> { )] /// Update the APT database pub fn apt_update_database( - notify: Option, - quiet: Option, + notify: bool, + quiet: bool, rpcenv: &mut dyn RpcEnvironment, ) -> Result { let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?; let to_stdout = rpcenv.env_type() == RpcEnvironmentType::CLI; - // FIXME: change to non-option in signature and drop below once we have proxmox-api-macro 0.2.3 - let quiet = quiet.unwrap_or(API_METHOD_APT_UPDATE_DATABASE_PARAM_DEFAULT_QUIET); - let notify = notify.unwrap_or(API_METHOD_APT_UPDATE_DATABASE_PARAM_DEFAULT_NOTIFY); let upid_str = WorkerTask::new_thread("aptupdate", None, auth_id, to_stdout, move |worker| { do_apt_update(&worker, quiet)?;