From 3960f3032349ad82336253b0ddfe9d4115a50543 Mon Sep 17 00:00:00 2001 From: Valerio Date: Tue, 9 Jun 2026 10:56:51 +0200 Subject: [PATCH] style: apply rustfmt to salvaged #49 commits --- crates/webclaw-cli/src/main.rs | 4 +++- crates/webclaw-fetch/src/lib.rs | 2 +- crates/webclaw-fetch/src/progress.rs | 15 ++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/webclaw-cli/src/main.rs b/crates/webclaw-cli/src/main.rs index 8f818dd..37a04ff 100644 --- a/crates/webclaw-cli/src/main.rs +++ b/crates/webclaw-cli/src/main.rs @@ -2948,7 +2948,9 @@ mod tests { assert!(!looks_truncated("https://example.com/path/to/page")); assert!(!looks_truncated("https://example.com/?a=1")); assert!(!looks_truncated("https://example.com/?a=1&b=2")); - assert!(!looks_truncated("https://example.com/?a=1&b=2&c=hello%20world")); + assert!(!looks_truncated( + "https://example.com/?a=1&b=2&c=hello%20world" + )); // Hash anchors without a query are clean. assert!(!looks_truncated("https://example.com/page#section")); } diff --git a/crates/webclaw-fetch/src/lib.rs b/crates/webclaw-fetch/src/lib.rs index 5e687ed..b859955 100644 --- a/crates/webclaw-fetch/src/lib.rs +++ b/crates/webclaw-fetch/src/lib.rs @@ -25,7 +25,7 @@ pub use error::FetchError; pub use fetcher::Fetcher; pub use http::HeaderMap; pub use locale::{accept_language_for_tld, accept_language_for_url}; -pub use progress::{with_progress, PROGRESS_INTERVAL}; +pub use progress::{PROGRESS_INTERVAL, with_progress}; pub use proxy::{parse_proxy_file, parse_proxy_line}; pub use sitemap::SitemapEntry; pub use webclaw_pdf::PdfMode; diff --git a/crates/webclaw-fetch/src/progress.rs b/crates/webclaw-fetch/src/progress.rs index 223f66d..75931dd 100644 --- a/crates/webclaw-fetch/src/progress.rs +++ b/crates/webclaw-fetch/src/progress.rs @@ -18,7 +18,7 @@ use std::future::Future; use std::time::Duration; -use tokio::time::{interval, Instant, MissedTickBehavior}; +use tokio::time::{Instant, MissedTickBehavior, interval}; /// Default progress emission interval. The first tick fires at +10s /// elapsed; subsequent ticks at +20s, +30s, etc. @@ -265,7 +265,8 @@ mod tests { fn test_truncate_url_unicode_safe() { // Cyrillic URL longer than 80 chars — must not panic on a // mid-codepoint split. - let url = "https://example.com/путь/к/очень/длинной/странице/с/большим/количеством/кириллицы/тут"; + let url = + "https://example.com/путь/к/очень/длинной/странице/с/большим/количеством/кириллицы/тут"; let truncated = truncate_url(url, 80); assert!(truncated.is_char_boundary(truncated.len())); // Roundtrip through chars to confirm valid UTF-8 throughout. @@ -275,10 +276,7 @@ mod tests { #[test] fn test_format_progress_line_shape() { let line = format_progress_line("https://example.com/", Duration::from_secs(10)); - assert_eq!( - line, - "# webclaw: still fetching https://example.com/ (10s)" - ); + assert_eq!(line, "# webclaw: still fetching https://example.com/ (10s)"); } #[test] @@ -287,6 +285,9 @@ mod tests { // the first tick fires at +PROGRESS_INTERVAL so this is mostly // a defensive shape assertion.) let line = format_progress_line("https://x/", Duration::from_millis(9_500)); - assert!(line.ends_with("(9s)"), "line should end with `(9s)`: {line:?}"); + assert!( + line.ends_with("(9s)"), + "line should end with `(9s)`: {line:?}" + ); } }