mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +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> {
|
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() {
|
if size.is_none() && list.is_none() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let mut b = Vec::with_capacity(list.map(|l| l.len()).unwrap_or_default() + 1);
|
let mut b = Vec::with_capacity(list.map(|l| l.len()).unwrap_or_default() + 1);
|
||||||
if let Some(s) = size {
|
if let Some(s) = size {
|
||||||
use crate::format::Format;
|
|
||||||
b.push(s.bytes())
|
b.push(s.bytes())
|
||||||
}
|
}
|
||||||
if let Some(l) = list {
|
if let Some(l) = list {
|
||||||
for (path, size) in l {
|
for (path, size) in l {
|
||||||
b.push(format!("* {path}: {size}"))
|
b.push(format!("{path} ({})", size.bytes()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(b.join("\n"))
|
Some(b.join("\n"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue