diff --git a/src/cli.rs b/src/cli.rs index 59fbc8f..6524f54 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -271,7 +271,11 @@ impl Cli { let mut args = vec![CString::new(binary).unwrap()]; let binary = which::which(binary) - .inspect_err(|e| log::error!("Cannot find the given binary: {e}")) + // Replace with inspect_err when result_option_inspect is stabilized + .map_err(|e| { + log::error!("Cannot find the given binary: {e}"); + e + }) .map(|ref path| CString::new(path.to_str().unwrap())) .unwrap_or(CString::new("")) .unwrap(); diff --git a/src/datasource/k8s.rs b/src/datasource/k8s.rs index 84d4117..1ae2e28 100644 --- a/src/datasource/k8s.rs +++ b/src/datasource/k8s.rs @@ -57,8 +57,10 @@ impl Source for ConfigMap { } async fn watch(&mut self, notify: Notifier) { - let Ok(client) = Client::try_default().await.inspect_err(|e| { + // Replace with inspect_err when result_option_inspect is stabilized + let Ok(client) = Client::try_default().await.map_err(|e| { log::error!("Could not get k8s client: {e}"); + e }) else { return; }; @@ -168,8 +170,10 @@ impl Source for Secret { } async fn watch(&mut self, notify: Notifier) { - let Ok(client) = Client::try_default().await.inspect_err(|e| { + // Replace with inspect_err when result_option_inspect is stabilized + let Ok(client) = Client::try_default().await.map_err(|e| { log::error!("Could not get k8s client: {e}"); + e }) else { return; };