summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-12-11 23:50:12 +0000
committerJohn Turner <jturner.usa@gmail.com>2025-12-14 01:37:49 +0000
commit682cfdac9f88b614f502c6352d72a051b6de9440 (patch)
tree01adf6d7195b45f4e96d43650f54664fbf6bda37
parent84cc87e6e4b131e2f3f3fca327129d998f7f6b9f (diff)
downloadgentoo-utils-682cfdac9f88b614f502c6352d72a051b6de9440.tar.gz
default to Eapi 0 if no eapi file exists
-rw-r--r--src/repo/profile/mod.rs6
1 files 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: Eapi,
deprecated: Option<String>,
#[get(kind = "deref")]
parents: Vec<Profile>,
@@ -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)),
};