This commit is contained in:
parent
b39666a72d
commit
6d428be193
@ -1,12 +1,13 @@
|
||||
use serde::Deserialize;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[allow(clippy::wildcard_imports)] // I use *-operator on purpose: I want to receive a compiler
|
||||
// warning if I've not updated my `create_classifier` function
|
||||
use crate::law::{self, responsible::*};
|
||||
use crate::law::{ClassifierApplicable, LawBuilder};
|
||||
use crate::misc::Error;
|
||||
use crate::paragraph::Parser;
|
||||
use serde::Deserialize;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
// TODO: more generic
|
||||
fn create_classifier(match_function: &str) -> Result<ClassifierApplicable, Error> {
|
||||
@ -22,8 +23,7 @@ fn create_classifier(match_function: &str) -> Result<ClassifierApplicable, Error
|
||||
"contains_without_unter" => Arc::new(contains_without_unter),
|
||||
_ => {
|
||||
return Err(Error::new(&format!(
|
||||
"Unknown match function: {}",
|
||||
match_function
|
||||
"Unknown match function: {match_function}"
|
||||
)))
|
||||
}
|
||||
};
|
||||
|
@ -12,7 +12,7 @@ pub fn contains(classifier_name: &str, instance_name: &str) -> bool {
|
||||
}
|
||||
|
||||
pub fn contains_case_sensitive(classifier_name: &str, instance_name: &str) -> bool {
|
||||
instance_name.contains(&classifier_name)
|
||||
instance_name.contains(classifier_name)
|
||||
}
|
||||
|
||||
pub fn starts_with_roman_number(_: &str, s: &str) -> bool {
|
||||
|
@ -89,12 +89,9 @@ fn fetch(url: &str) -> Result<String, Error> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::fs;
|
||||
|
||||
use std::{fs};
|
||||
|
||||
use crate::{
|
||||
config::Config,
|
||||
};
|
||||
use crate::config::Config;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user