diff options
author | Akshay <[email protected]> | 2020-07-12 16:05:12 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-07-12 16:05:12 +0100 |
commit | 2b3ba619402a9d6a5408d35bb38ef31f7e488ec5 (patch) | |
tree | 2651b4271a4b6048ec2dc3d1c703f9d3b5f02395 /src/main.rs | |
parent | f2b87509ac4b08444499a7bc61a9bc4a100c414b (diff) |
remove unused imports, upgrade to cursive v0.15
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/src/main.rs b/src/main.rs index 387dc64..2313201 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -1,7 +1,5 @@ | |||
1 | #![allow(unused_must_use)] | 1 | #![allow(unused_must_use)] |
2 | 2 | ||
3 | use std::default::Default; | ||
4 | |||
5 | mod app; | 3 | mod app; |
6 | mod command; | 4 | mod command; |
7 | mod habit; | 5 | mod habit; |
@@ -11,48 +9,18 @@ mod views; | |||
11 | 9 | ||
12 | use crate::app::App; | 10 | use crate::app::App; |
13 | use crate::command::{open_command_window, Command}; | 11 | use crate::command::{open_command_window, Command}; |
14 | use crate::habit::{Bit, Count, Habit}; | ||
15 | use crate::utils::{load_configuration_file, AppConfig}; | 12 | use crate::utils::{load_configuration_file, AppConfig}; |
16 | 13 | ||
17 | use chrono::NaiveDate; | 14 | use cursive::crossterm; |
18 | use cursive::theme::{BaseColor, Color}; | ||
19 | use cursive::views::NamedView; | 15 | use cursive::views::NamedView; |
20 | use cursive::Cursive; | ||
21 | use lazy_static::lazy_static; | 16 | use lazy_static::lazy_static; |
22 | use serde::{Deserialize, Serialize}; | ||
23 | 17 | ||
24 | lazy_static! { | 18 | lazy_static! { |
25 | pub static ref CONFIGURATION: AppConfig = load_configuration_file(); | 19 | pub static ref CONFIGURATION: AppConfig = load_configuration_file(); |
26 | } | 20 | } |
27 | 21 | ||
28 | fn main() { | 22 | fn main() { |
29 | let mut s = Cursive::crossterm().unwrap(); | 23 | let mut s = crossterm().unwrap(); |
30 | |||
31 | // let mut gymming = Count::new("gym", 5); | ||
32 | // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 11), 7); | ||
33 | // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 12), 8); | ||
34 | // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 13), 9); | ||
35 | // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 14), 10); | ||
36 | // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 15), 11); | ||
37 | |||
38 | // let mut reading = Bit::new("read"); | ||
39 | // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 11), true.into()); | ||
40 | // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 12), false.into()); | ||
41 | // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 13), true.into()); | ||
42 | // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 14), false.into()); | ||
43 | // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 15), true.into()); | ||
44 | |||
45 | // let mut walking = Bit::new("walk"); | ||
46 | // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 11), true.into()); | ||
47 | // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 12), false.into()); | ||
48 | // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 13), true.into()); | ||
49 | // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 14), false.into()); | ||
50 | // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 15), true.into()); | ||
51 | |||
52 | // app.add_habit(Box::new(gymming)); | ||
53 | // app.add_habit(Box::new(reading)); | ||
54 | // app.add_habit(Box::new(walking)); | ||
55 | |||
56 | let app = App::load_state(); | 24 | let app = App::load_state(); |
57 | s.add_layer(NamedView::new("Main", app)); | 25 | s.add_layer(NamedView::new("Main", app)); |
58 | s.add_global_callback(':', |s| open_command_window(s)); | 26 | s.add_global_callback(':', |s| open_command_window(s)); |