mirror of
https://github.com/nimbold/Firelink.git
synced 2026-07-26 12:08:27 +00:00
dc9289fece
- Restructured layout so the sidebar acts as an edge-to-edge curved layer with a shadow - Replaced old download categories with Musics, Movies, Compressed, Documents, Pictures, Applications, and Other - Updated Settings > Locations tab to handle the new categories - Added extensive predefined file extensions for smart auto-categorization of downloads
14 lines
473 B
Rust
14 lines
473 B
Rust
use regex::Regex;
|
|
|
|
fn main() {
|
|
let pct_re = Regex::new(r"\[download\]\s+(\d+(?:\.\d+)?)%").unwrap();
|
|
let line = "[download] 0.0% of 15.59MiB at 7.28KiB/s ETA 36:34";
|
|
if line.contains("[download]") && line.contains("%") {
|
|
let fraction = pct_re.captures(&line)
|
|
.and_then(|cap| cap.get(1))
|
|
.and_then(|m| m.as_str().parse::<f64>().ok())
|
|
.unwrap_or(0.0) / 100.0;
|
|
println!("Fraction: {}", fraction);
|
|
}
|
|
}
|