rearrange modules

This commit is contained in:
John Turner
2025-11-22 02:11:52 +00:00
parent bffc1e88b0
commit f8149b43d4
8 changed files with 25 additions and 24 deletions

View File

@@ -8,7 +8,7 @@ use std::{
use gentoo_utils::{
atom::Atom,
ebuild::{Depend, repo::Repo},
repo::{Repo, ebuild::Depend},
};
fn main() -> Result<(), Box<dyn Error>> {

View File

@@ -6,7 +6,7 @@ use std::{
path::PathBuf,
};
use gentoo_utils::ebuild::repo::Repo;
use gentoo_utils::repo::Repo;
fn main() -> Result<(), Box<dyn Error>> {
let corpus_dir = PathBuf::from(

View File

@@ -10,7 +10,7 @@ use get::Get;
use itertools::Itertools;
pub mod parsers;
mod parsers;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Blocker {

View File

@@ -16,5 +16,5 @@ pub trait Parseable<'a, I: Input + 'a> {
}
pub mod atom;
pub mod ebuild;
pub mod repo;
pub mod useflag;

View File

@@ -6,8 +6,7 @@ use crate::{
useflag::{IUseFlag, UseFlag},
};
pub mod parsers;
pub mod repo;
mod parsers;
#[derive(Clone, Debug)]
pub enum Conditional {
@@ -59,26 +58,26 @@ pub struct Eclass(#[get(method = "get", kind = "deref")] String);
#[derive(Debug, Clone, Get)]
pub struct Ebuild {
name: Name,
version: Version,
slot: Option<Slot>,
homepage: Option<String>,
pub(super) name: Name,
pub(super) version: Version,
pub(super) slot: Option<Slot>,
pub(super) homepage: Option<String>,
#[get(kind = "deref")]
src_uri: Vec<Depend<SrcUri>>,
eapi: Option<Eapi>,
pub(super) src_uri: Vec<Depend<SrcUri>>,
pub(super) eapi: Option<Eapi>,
#[get(kind = "deref")]
inherit: Vec<Eclass>,
pub(super) inherit: Vec<Eclass>,
#[get(kind = "deref")]
iuse: Vec<IUseFlag>,
pub(super) iuse: Vec<IUseFlag>,
#[get(kind = "deref")]
license: Vec<Depend<License>>,
description: Option<String>,
pub(super) license: Vec<Depend<License>>,
pub(super) description: Option<String>,
#[get(kind = "deref")]
depend: Vec<Depend<Atom>>,
pub(super) depend: Vec<Depend<Atom>>,
#[get(kind = "deref")]
bdepend: Vec<Depend<Atom>>,
pub(super) bdepend: Vec<Depend<Atom>>,
#[get(kind = "deref")]
rdepend: Vec<Depend<Atom>>,
pub(super) rdepend: Vec<Depend<Atom>>,
#[get(kind = "deref")]
idepend: Vec<Depend<Atom>>,
pub(super) idepend: Vec<Depend<Atom>>,
}

View File

@@ -6,7 +6,7 @@ use mon::{
use crate::{
Parseable,
ebuild::{Conditional, Depend, Eapi, Eclass, License, SrcUri, Uri, UriPrefix},
repo::ebuild::{Conditional, Depend, Eapi, Eclass, License, SrcUri, Uri, UriPrefix},
useflag::UseFlag,
};
@@ -174,7 +174,7 @@ mod test {
use mon::{ParserIter, input::InputIter};
use crate::{atom::Atom, ebuild::Depend};
use crate::{atom::Atom, repo::ebuild::Depend};
use super::*;

View File

@@ -10,10 +10,12 @@ use mon::{Parser, ParserIter, ascii_whitespace1, input::InputIter, tag};
use crate::{
Parseable,
atom::{self, Atom},
ebuild::{Depend, Eapi, Ebuild, Eclass, License, SrcUri},
repo::ebuild::{Depend, Eapi, Ebuild, Eclass, License, SrcUri},
useflag::IUseFlag,
};
pub mod ebuild;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("io error: {0}")]

View File

@@ -2,7 +2,7 @@ use core::fmt;
use get::Get;
pub mod parsers;
mod parsers;
#[derive(Clone, Debug, PartialEq, Eq, Get)]
pub struct UseFlag(#[get(method = "name", kind = "deref")] String);