From 008dbe785d4cbc715eeb5ce07fa84cd4cbe8916c Mon Sep 17 00:00:00 2001 From: death916 Date: Thu, 26 Mar 2026 02:50:44 -0700 Subject: [PATCH] cargo fmt --- rustclock/src/main.rs | 10 +++++++--- rustclock/src/news.rs | 1 - rustclock/src/panes.rs | 6 ++---- rustclock/src/sports.rs | 2 +- rustclock/src/weather.rs | 11 +++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/rustclock/src/main.rs b/rustclock/src/main.rs index 7be9ad1..e01a340 100644 --- a/rustclock/src/main.rs +++ b/rustclock/src/main.rs @@ -20,7 +20,12 @@ const WEATHER_UPDATE_TIME_MINS: u64 = 30; pub fn main() -> iced::Result { iced::application( - || (RustClock::default(), Task::perform(weather::get_weather(), Message::UpdateWeatherImg)), // Wrap it in a closure + || { + ( + RustClock::default(), + Task::perform(weather::get_weather(), Message::UpdateWeatherImg), + ) + }, // Wrap it in a closure RustClock::update, RustClock::view, ) @@ -70,7 +75,7 @@ impl RustClock { Task::none() } Message::PaneDragged(_) => Task::none(), - + Message::PaneResized(pane_grid::ResizeEvent { split, ratio }) => { self.panes.resize(split, ratio); Task::none() @@ -138,7 +143,6 @@ impl Default for RustClock { .into_iter() .map(|(k, v)| (k, Handle::from_bytes(v))) .collect(); - RustClock { current_time: Local::now(), diff --git a/rustclock/src/news.rs b/rustclock/src/news.rs index 6c5e162..9e9e79c 100644 --- a/rustclock/src/news.rs +++ b/rustclock/src/news.rs @@ -2,7 +2,6 @@ use rss::Channel; use std::fs::File; use std::io::{BufRead, BufReader}; - pub async fn get_news() -> Vec { let feeds = File::open("../feeds.txt"); let mut feed_vec = Vec::new(); diff --git a/rustclock/src/panes.rs b/rustclock/src/panes.rs index e1413b4..6d182ba 100644 --- a/rustclock/src/panes.rs +++ b/rustclock/src/panes.rs @@ -2,10 +2,9 @@ use chrono::Local; use iced::Border; use iced::Element; use iced::Fill; +use iced::widget::scrollable::{Direction, Scrollbar}; use iced::widget::{column, container, image, row, scrollable, text}; use std::collections::HashMap; -use iced::widget::scrollable::{Direction, Scrollbar}; - use crate::Message; use crate::sports::Game; @@ -121,7 +120,7 @@ pub fn render_mlb_pane<'a>( }) .into() }))) - .direction(Direction::Vertical(Scrollbar::hidden())) + .direction(Direction::Vertical(Scrollbar::hidden())) .into() } @@ -155,4 +154,3 @@ pub fn render_weather_pane<'a>( .center_y(Fill) .into() } - diff --git a/rustclock/src/sports.rs b/rustclock/src/sports.rs index b2f42ad..a615879 100644 --- a/rustclock/src/sports.rs +++ b/rustclock/src/sports.rs @@ -212,4 +212,4 @@ mod tests { let mlb_scores = update_mlb(); assert!(!mlb_scores.is_empty()); } -} \ No newline at end of file +} diff --git a/rustclock/src/weather.rs b/rustclock/src/weather.rs index 6ee10bd..42f3324 100644 --- a/rustclock/src/weather.rs +++ b/rustclock/src/weather.rs @@ -18,9 +18,8 @@ pub async fn get_weather() -> Handle { #[tokio::test] - async fn test_get_weather() { - let handle = get_weather().await; - let handle_type: Handle = handle.clone(); - assert_eq!(handle_type, handle); - } - +async fn test_get_weather() { + let handle = get_weather().await; + let handle_type: Handle = handle.clone(); + assert_eq!(handle_type, handle); +}