From e8ca6574ad136996fbf076eb788696ab062cee98 Mon Sep 17 00:00:00 2001 From: Justin Rubek <25621857+justinrubek@users.noreply.github.com> Date: Sat, 4 May 2024 15:57:15 -0500 Subject: [PATCH] refactor!: remove async from functions that do not use it --- crates/project-base-directory/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/project-base-directory/src/lib.rs b/crates/project-base-directory/src/lib.rs index 0395c09..de8c356 100644 --- a/crates/project-base-directory/src/lib.rs +++ b/crates/project-base-directory/src/lib.rs @@ -24,8 +24,8 @@ pub struct Project { impl Project { /// Retrieve the project information detected from current directory. - pub async fn discover() -> Result { - let project_root = get_project_root().await?; + pub fn discover() -> Result { + let project_root = get_project_root()?; let project_data = std::env::var(constants::PROJECT_DATA_HOME) .map(PathBuf::from) .ok(); @@ -49,8 +49,7 @@ impl Project { /// Retrieve the project information detected from the given directory. /// If a property is not set, then an opinionated default is used. pub async fn discover_and_assume() -> Result { - let mut value = Self::discover().await?; - + let mut value = Self::discover()?; // If the project root is not found, give up. match value.root_directory { Some(_) => {} @@ -143,7 +142,7 @@ impl Project { /// If the environment variable $PRJ_ROOT is set its value will be used. /// Otherwise, a best effort is made to find the project root using the following technies: /// - Searching upwards for a git repository -pub async fn get_project_root() -> Result> { +pub fn get_project_root() -> Result> { let project_root = std::env::var(constants::PROJECT_ROOT).ok(); if let Some(project_root) = project_root { debug!(