mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 09:05:33 +00:00
update list style, format bytes
This commit is contained in:
parent
48ca526a67
commit
47e6899ccd
1 changed files with 2 additions and 2 deletions
|
|
@ -93,17 +93,17 @@ impl Rss {
|
|||
}
|
||||
|
||||
pub fn item_description(size: Option<u64>, list: Option<&Vec<(String, u64)>>) -> Option<String> {
|
||||
use crate::format::Format;
|
||||
if size.is_none() && list.is_none() {
|
||||
return None;
|
||||
}
|
||||
let mut b = Vec::with_capacity(list.map(|l| l.len()).unwrap_or_default() + 1);
|
||||
if let Some(s) = size {
|
||||
use crate::format::Format;
|
||||
b.push(s.bytes())
|
||||
}
|
||||
if let Some(l) = list {
|
||||
for (path, size) in l {
|
||||
b.push(format!("* {path}: {size}"))
|
||||
b.push(format!("{path} ({})", size.bytes()))
|
||||
}
|
||||
}
|
||||
Some(b.join("\n"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue