From b2a6ec33da4563ab279741d73bf9d1ed15756b7c Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Tue, 26 Mar 2024 14:00:24 +0100 Subject: [PATCH] Fix another windows compilation error --- lib/system/env/windows.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/system/env/windows.rs b/lib/system/env/windows.rs index a1d3f93..3361aec 100644 --- a/lib/system/env/windows.rs +++ b/lib/system/env/windows.rs @@ -3,7 +3,10 @@ use std::path::Path; use tokio::task::spawn_blocking; use winreg::{enums::HKEY_CURRENT_USER, RegKey}; -use crate::{result::RokitResult, storage::Home}; +use crate::{ + result::{RokitError, RokitResult}, + storage::Home, +}; pub async fn add_to_path(home: &Home) -> RokitResult { // NOTE: Calls to canonicalize may use blocking filesystem @@ -23,13 +26,13 @@ pub async fn add_to_path(home: &Home) -> RokitResult { }); if path_already_exists { - Ok(false) + Ok::<_, RokitError>(false) } else { let new_path = format!("{path};{}", dir.display()); env.set_value("PATH", &new_path)?; - Ok(true) + Ok::<_, RokitError>(true) } }); - Ok(task.await??) + task.await? }