rename lawbuilder to builder to not have law twice in law::LawBuilder
All checks were successful
CI/CD Pipeline / test (push) Successful in 4m44s
All checks were successful
CI/CD Pipeline / test (push) Successful in 4m44s
This commit is contained in:
@@ -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, "");
|
||||
|
Reference in New Issue
Block a user