mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-08 16:40:00 +02:00
fix clippy lints
This commit is contained in:
parent
3138d664d6
commit
b73448b189
2 changed files with 4 additions and 10 deletions
12
src/lib.rs
12
src/lib.rs
|
@ -508,10 +508,7 @@ impl ArticleScraper {
|
|||
tag: Option<&str>,
|
||||
attribute: &str,
|
||||
) -> Result<(), ScraperError> {
|
||||
let xpath_tag = match tag {
|
||||
Some(tag) => tag,
|
||||
None => "*",
|
||||
};
|
||||
let xpath_tag = tag.unwrap_or("*");
|
||||
|
||||
let xpath = &format!("//{}[@{}]", xpath_tag, attribute);
|
||||
let node_vec = Self::evaluate_xpath(context, xpath, false)?;
|
||||
|
@ -529,10 +526,7 @@ impl ArticleScraper {
|
|||
attribute: &str,
|
||||
value: &str,
|
||||
) -> Result<(), ScraperError> {
|
||||
let xpath_tag = match tag {
|
||||
Some(tag) => tag,
|
||||
None => "*",
|
||||
};
|
||||
let xpath_tag = tag.unwrap_or("*");
|
||||
|
||||
let xpath = &format!("//{}", xpath_tag);
|
||||
let node_vec = Self::evaluate_xpath(context, xpath, false)?;
|
||||
|
@ -598,7 +592,7 @@ impl ArticleScraper {
|
|||
}
|
||||
|
||||
if !completed_url.ends_with('/') && !incomplete_url.starts_with('/') {
|
||||
completed_url.push_str("/");
|
||||
completed_url.push('/');
|
||||
}
|
||||
completed_url.push_str(incomplete_url);
|
||||
let url = url::Url::parse(&completed_url).context(ScraperErrorKind::Url)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue