diff --git a/src/config.rs b/src/config.rs index 2a07c21..3b57504 100644 --- a/src/config.rs +++ b/src/config.rs @@ -59,7 +59,7 @@ impl Config { let config_str = fs::read_to_string(path)?; 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 { let to_add = law::Classifier::new( &classifier.name, diff --git a/src/law/mod.rs b/src/law/mod.rs index 6594287..b711cb3 100644 --- a/src/law/mod.rs +++ b/src/law/mod.rs @@ -166,15 +166,15 @@ impl PartialEq for LawBuilder { impl Default for LawBuilder { fn default() -> Self { - Self::new() + Self::new("".into()) } } impl LawBuilder { /// Creates a new law builder. Adds classifier for known law texts. - pub fn new() -> Self { + pub fn new(name: String) -> Self { Self { - name: "".into(), + name, classifiers: Vec::new(), header: Vec::new(), next_para_header: None,