From 7e61192fbac6fbb20f9ac395f391f280021778a0 Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 11 Dec 2025 23:50:12 +0000 Subject: [PATCH] default to Eapi 0 if no eapi file exists --- src/repo/profile/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/repo/profile/mod.rs b/src/repo/profile/mod.rs index 31861b9..8bdb724 100644 --- a/src/repo/profile/mod.rs +++ b/src/repo/profile/mod.rs @@ -64,7 +64,7 @@ pub enum Error { pub struct Profile { #[get(kind = "deref")] path: PathBuf, - eapi: Option, + eapi: Eapi, deprecated: Option, #[get(kind = "deref")] parents: Vec, @@ -108,9 +108,9 @@ impl Profile { let eapi = match fs::read_to_string(&eapi_path) .map(|s| Eapi::parse(s.trim()).map_err(str::to_string)) { - Ok(Ok(eapi)) => Some(eapi), + Ok(Ok(eapi)) => eapi, Ok(Err(rest)) => return Err(Error::Parser(rest)), - Err(e) if matches!(e.kind(), io::ErrorKind::NotFound) => None, + Err(e) if matches!(e.kind(), io::ErrorKind::NotFound) => Eapi::parse("0").unwrap(), Err(e) => return Err(Error::Io(eapi_path, e)), };