1
0

fix compiler warnings

This commit is contained in:
Rokas Puzonas 2023-01-29 23:51:49 +02:00
parent 0602d668bc
commit 640a0a8835
4 changed files with 6 additions and 9 deletions

View File

@ -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<Config>,
assets: Option<AppAssets>,
vidko_textfield: String,
screen: Option<Rc<RefCell<dyn Screen>>>
}
@ -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
}

View File

@ -100,6 +100,7 @@ pub struct MemoryConfigStore {
config: Option<Config>
}
impl MemoryConfigStore {
#[allow(unused)]
pub fn new(config: Config) -> Self {
Self { config: Some(config) }
}

View File

@ -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

View File

@ -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<Timetable, GetTimetableError> {
fn get(&self, _vidko: &str) -> Result<Timetable, GetTimetableError> {
Ok(self.timetable.clone())
}
}