diff options
author | eri <eri@inventati.org> | 2024-03-13 09:31:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 08:31:58 +0000 |
commit | 03d64d0675d4d1878232829293e7fdacaec5844e (patch) | |
tree | 6162101c1928052c9c08232e4e7ac784a875a64f /components/metrics | |
parent | 0fda14263a206d99792fcfbec6a5f6dfdb5ff337 (diff) | |
download | servo-03d64d0675d4d1878232829293e7fdacaec5844e.tar.gz servo-03d64d0675d4d1878232829293e7fdacaec5844e.zip |
clippy: Fix assorted warnings in `components/` (#31628)
* clippy: fix assorted warnings in `components/`
* fix: new and default
* fix: review comments
Diffstat (limited to 'components/metrics')
-rw-r--r-- | components/metrics/lib.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/components/metrics/lib.rs b/components/metrics/lib.rs index 971ad729441..7aa42f365ae 100644 --- a/components/metrics/lib.rs +++ b/components/metrics/lib.rs @@ -75,13 +75,7 @@ fn set_metric<U: ProgressiveWebMetric>( pwm.send_queued_constellation_msg(metric_type, time); // Send the metric to the time profiler. - send_profile_data( - category, - metadata, - &pwm.get_time_profiler_chan(), - time, - time, - ); + send_profile_data(category, metadata, pwm.get_time_profiler_chan(), time, time); // Print the metric to console if the print-pwm option was given. if opts::get().print_pwm { @@ -119,13 +113,15 @@ pub struct InteractiveWindow { start: SystemTime, } -impl InteractiveWindow { - pub fn new() -> InteractiveWindow { - InteractiveWindow { +impl Default for InteractiveWindow { + fn default() -> Self { + Self { start: SystemTime::now(), } } +} +impl InteractiveWindow { // We need to either start or restart the 10s window // start: we've added a new document // restart: there was a task > 50ms @@ -163,7 +159,7 @@ impl InteractiveMetrics { dom_content_loaded: Cell::new(None), main_thread_available: Cell::new(None), time_to_interactive: Cell::new(None), - time_profiler_chan: time_profiler_chan, + time_profiler_chan, url, } } |