rename lawbuilder to builder to not have law twice in law::LawBuilder
All checks were successful
CI/CD Pipeline / test (push) Successful in 4m44s

This commit is contained in:
2024-02-27 08:52:53 +01:00
parent d25785984d
commit b8a6cccf0b
5 changed files with 21 additions and 21 deletions

View File

@@ -28,7 +28,7 @@ use std::{
use log::info;
use crate::{
law::LawBuilder,
law,
misc::{fetch_with_retries, get_cache_dir, Error},
};
@@ -67,8 +67,8 @@ impl Parser {
self.replace.push((search.into(), replace.into()));
}
/// Parses the content available in `url`. Calls appropriate functions in supplied `LawBuilder`.
pub fn parse(&self, url: &str, builder: &mut LawBuilder) -> Result<bool, Error> {
/// Parses the content available in `url`. Calls appropriate functions in supplied `Builder`.
pub fn parse(&self, url: &str, builder: &mut law::Builder) -> Result<bool, Error> {
info!("Parsing {url}");
let xml = fetch(url)?;
@@ -77,7 +77,7 @@ impl Parser {
self.parse_from_str(&xml, builder)
}
fn parse_from_str(&self, xml: &str, builder: &mut LawBuilder) -> Result<bool, Error> {
fn parse_from_str(&self, xml: &str, builder: &mut law::Builder) -> Result<bool, Error> {
let mut xml = String::from(xml);
for r in &self.remove {
xml = xml.replace(r, "");