mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-07 16:15:32 +02:00
fmt
This commit is contained in:
parent
a1ee3b22f9
commit
0dcebe8b49
1 changed files with 9 additions and 9 deletions
|
@ -1,5 +1,3 @@
|
|||
use std::collections::HashSet;
|
||||
use std::fmt::Write;
|
||||
use libxml::{
|
||||
tree::{Document, Node, NodeType, SaveOptions},
|
||||
xpath::Context,
|
||||
|
@ -8,6 +6,8 @@ use reqwest::{
|
|||
header::{HeaderMap, HeaderName, HeaderValue, CONTENT_LENGTH, CONTENT_TYPE},
|
||||
Response,
|
||||
};
|
||||
use std::collections::HashSet;
|
||||
use std::fmt::Write;
|
||||
use tokio::fs::DirEntry;
|
||||
|
||||
use crate::{
|
||||
|
@ -204,13 +204,13 @@ impl Util {
|
|||
let node_vec = Util::evaluate_xpath(context, xpath, true)?;
|
||||
let mut val = String::new();
|
||||
for node in node_vec {
|
||||
let part = node
|
||||
.get_content()
|
||||
.split_whitespace()
|
||||
.fold(String::new(), |mut output, s| {
|
||||
let _ = write!(output, " {s}");
|
||||
output
|
||||
});
|
||||
let part =
|
||||
node.get_content()
|
||||
.split_whitespace()
|
||||
.fold(String::new(), |mut output, s| {
|
||||
let _ = write!(output, " {s}");
|
||||
output
|
||||
});
|
||||
val.push_str(&part);
|
||||
val.push(' ');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue