Support proper locating of Nest.toml; Cleanup.

This commit is contained in:
Olivia Brooks
2026-01-26 21:19:51 -05:00
parent ac364caede
commit 56a86b371a
3 changed files with 30 additions and 56 deletions

View File

@@ -11,14 +11,8 @@ use anyhow::Context;
use semver::Version;
use serde::{Deserialize, Serialize};
pub static NEST: LazyLock<anyhow::Result<Nest>> = LazyLock::new(|| {
Nest::try_from(
PROJECT_ROOT
.lock()
.expect("Failed to lock mutex")
.join(F_NEST_TOML.as_path()),
)
});
pub static NEST: LazyLock<anyhow::Result<Nest>> =
LazyLock::new(|| Nest::try_from(PROJECT_ROOT.join(F_NEST_TOML.as_path())));
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Nest {
@@ -133,16 +127,12 @@ impl Class {
// If the source file exists, hasn't been moved to a package (path is a file) and
// the associated compiled class file exists in DIR_TARGET
PROJECT_ROOT
.lock()
.expect("Failed to lock mutex")
.join(DIR_TARGET.as_path())
.join(self.name.as_path())
.with_extension(JAVA_EXT_CLASS)
.exists()
&& sha256::try_digest(
PROJECT_ROOT
.lock()
.expect("Failed to lock mutex")
.join(if self.test {
DIR_TEST.clone()
} else {