From 640a0a88356310e0cda4aeaa4856a941c6f1e815 Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Sun, 29 Jan 2023 23:51:49 +0200 Subject: [PATCH] fix compiler warnings --- src/app.rs | 6 +----- src/config.rs | 1 + src/main.rs | 5 ++--- src/timetable.rs | 3 ++- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/app.rs b/src/app.rs index 71e1945..8788718 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,4 +1,4 @@ -use std::{ops::Add, rc::Rc, cell::{Cell, RefCell}, f64::consts::E}; +use std::{ops::Add, rc::Rc, cell::RefCell}; use eframe::{egui, CreationContext}; use chrono::{Datelike, NaiveDate, Weekday, IsoWeek, Duration, Days, Local}; @@ -29,7 +29,6 @@ pub struct MainApp { config: Option, assets: Option, - vidko_textfield: String, screen: Option>> } @@ -51,8 +50,6 @@ fn get_current_week() -> IsoWeek { fn get_future_week(week_offset: u64) -> IsoWeek { let now_week = get_current_week(); - let year = now_week.year(); - let week = now_week.week(); let week_date = NaiveDate::from_isoywd_opt(now_week.year(), now_week.week(), Weekday::Mon).expect("Invalid week or year given"); week_date.checked_add_days(Days::new(7 * week_offset)).unwrap().iso_week() } @@ -144,7 +141,6 @@ impl MainApp { assets: None, config_store, config: None, - vidko_textfield: String::new(), timetable_getter, screen: None } diff --git a/src/config.rs b/src/config.rs index cb0764c..47b9efc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -100,6 +100,7 @@ pub struct MemoryConfigStore { config: Option } impl MemoryConfigStore { + #[allow(unused)] pub fn new(config: Config) -> Self { Self { config: Some(config) } } diff --git a/src/main.rs b/src/main.rs index a77f722..375131a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,10 +10,9 @@ mod utils; extern crate lazy_static; use app::MainApp; -use chrono::{Local, NaiveDate, NaiveTime}; -use config::{MemoryConfigStore, Config, TomlConfigStore}; +use config::TomlConfigStore; use eframe::egui; -use timetable::{DummyTimetableGetter, Timetable, Event, BlockingTimetableGetter}; +use timetable::BlockingTimetableGetter; // TODO: show errors when loading config // TODO: Settings menu diff --git a/src/timetable.rs b/src/timetable.rs index 5ab526d..0638a26 100644 --- a/src/timetable.rs +++ b/src/timetable.rs @@ -139,12 +139,13 @@ pub struct DummyTimetableGetter { timetable: Timetable } impl DummyTimetableGetter { + #[allow(unused)] pub fn new(timetable: Timetable) -> Self { Self { timetable } } } impl TimetableGetter for DummyTimetableGetter { - fn get(&self, vidko: &str) -> Result { + fn get(&self, _vidko: &str) -> Result { Ok(self.timetable.clone()) } } \ No newline at end of file