actually use filename from config
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m55s

This commit is contained in:
philipp 2024-02-17 10:48:45 +01:00
parent b8de9e94af
commit 1732f40534
2 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@ impl Config {
let config_str = fs::read_to_string(path)?; let config_str = fs::read_to_string(path)?;
let config: Config = toml::from_str(&config_str)?; let config: Config = toml::from_str(&config_str)?;
let mut builder = LawBuilder::new(); let mut builder = LawBuilder::new(config.law.name);
for classifier in config.law.classifiers { for classifier in config.law.classifiers {
let to_add = law::Classifier::new( let to_add = law::Classifier::new(
&classifier.name, &classifier.name,

View File

@ -166,15 +166,15 @@ impl PartialEq for LawBuilder {
impl Default for LawBuilder { impl Default for LawBuilder {
fn default() -> Self { fn default() -> Self {
Self::new() Self::new("".into())
} }
} }
impl LawBuilder { impl LawBuilder {
/// Creates a new law builder. Adds classifier for known law texts. /// Creates a new law builder. Adds classifier for known law texts.
pub fn new() -> Self { pub fn new(name: String) -> Self {
Self { Self {
name: "".into(), name,
classifiers: Vec::new(), classifiers: Vec::new(),
header: Vec::new(), header: Vec::new(),
next_para_header: None, next_para_header: None,