1
0
Fork 0
mirror of https://gitlab.com/news-flash/article_scraper.git synced 2025-07-08 08:30:00 +02:00

use global rules

This commit is contained in:
Jan Lukas Gernert 2022-10-06 11:50:09 +02:00
parent 3a6a70ee64
commit c1ae011fcd
9 changed files with 209 additions and 150 deletions

View file

@ -23,4 +23,15 @@ impl Util {
pub fn split_values(values: &str) -> Vec<&str> {
values.split('|').map(|s| s.trim()).collect()
}
pub fn select_rule<'a>(
site_specific_rule: Option<&'a str>,
global_rule: Option<&'a str>,
) -> Option<&'a str> {
if site_specific_rule.is_some() {
site_specific_rule
} else {
global_rule
}
}
}