From 7fa62ef1f960cede4c31240159fb1ce56724c816 Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 6 Feb 2024 11:45:44 +0100 Subject: [PATCH] restructure project --- src/config.rs | 2 +- src/law/mod.rs | 2 +- src/lib.rs | 6 ++++-- src/{risparser => }/overview/mod.rs | 4 ++-- src/{risparser => }/overview/ris_structure.rs | 0 src/{risparser => }/paragraph/mod.rs | 0 src/{risparser => }/paragraph/parser.rs | 0 src/risparser/mod.rs | 4 ---- 8 files changed, 8 insertions(+), 10 deletions(-) rename src/{risparser => }/overview/mod.rs (98%) rename src/{risparser => }/overview/ris_structure.rs (100%) rename src/{risparser => }/paragraph/mod.rs (100%) rename src/{risparser => }/paragraph/parser.rs (100%) delete mode 100644 src/risparser/mod.rs diff --git a/src/config.rs b/src/config.rs index 242a8ed..07076d7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use crate::law::{self, responsible::*}; use crate::law::{ClassifierApplicable, LawBuilder}; use crate::misc::Error; -use crate::risparser::paragraph::Parser; +use crate::paragraph::Parser; // TODO: more generic fn create_classifier(match_function: &str) -> Result { diff --git a/src/law/mod.rs b/src/law/mod.rs index 4368352..0734a24 100644 --- a/src/law/mod.rs +++ b/src/law/mod.rs @@ -7,7 +7,7 @@ use std::{ sync::Arc, }; -use crate::{config::Config, misc::Error, risparser::overview::parse}; +use crate::{config::Config, misc::Error, overview::parse}; pub mod responsible; diff --git a/src/lib.rs b/src/lib.rs index 4479647..f7a119e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,6 @@ pub mod config; -pub mod law; pub mod misc; -pub mod risparser; + +pub mod law; +pub mod overview; +pub mod paragraph; diff --git a/src/risparser/overview/mod.rs b/src/overview/mod.rs similarity index 98% rename from src/risparser/overview/mod.rs rename to src/overview/mod.rs index 3b795c3..1053e3d 100644 --- a/src/risparser/overview/mod.rs +++ b/src/overview/mod.rs @@ -29,7 +29,7 @@ use ris_structure::OgdSearchResult; /// /// # Example /// ``` -/// use risp::risparser::overview::parse; +/// use risp::overview::parse; /// /// let list_with_xml_links_to_paragraphs = parse(10001905).unwrap(); /// assert_eq!(list_with_xml_links_to_paragraphs.len(), 31); // TEG has 31 paragraphs @@ -128,7 +128,7 @@ fn fetch_page(overview_id: usize, page: usize) -> Result { #[cfg(test)] mod tests { - use crate::risparser::overview::parse; + use crate::overview::parse; use pretty_assertions::assert_eq; use std::fs; diff --git a/src/risparser/overview/ris_structure.rs b/src/overview/ris_structure.rs similarity index 100% rename from src/risparser/overview/ris_structure.rs rename to src/overview/ris_structure.rs diff --git a/src/risparser/paragraph/mod.rs b/src/paragraph/mod.rs similarity index 100% rename from src/risparser/paragraph/mod.rs rename to src/paragraph/mod.rs diff --git a/src/risparser/paragraph/parser.rs b/src/paragraph/parser.rs similarity index 100% rename from src/risparser/paragraph/parser.rs rename to src/paragraph/parser.rs diff --git a/src/risparser/mod.rs b/src/risparser/mod.rs deleted file mode 100644 index 275b913..0000000 --- a/src/risparser/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -//! This deals with accessing RIS data. - -pub mod overview; -pub mod paragraph;