1use std;
2
3#[derive(Debug)]
4pub struct StaticConfig {
5 pub users_per_page: usize,
6 pub users_in_top_users: usize,
7 pub top_drinks_per_user: usize,
8 pub use_persistence: bool,
9 pub persistence_file_path: String,
10}
11
12impl StaticConfig {
13 pub fn default_persistence(filepath: &str) -> Self {
14 return StaticConfig {
15 users_per_page: 40,
16 users_in_top_users: 40,
17 top_drinks_per_user: 4,
18 use_persistence: true,
19 persistence_file_path: filepath.to_string(),
20 };
21 }
22}
23
24impl Default for StaticConfig {
25 fn default() -> Self {
26 return StaticConfig {
27 users_per_page: 20,
28 users_in_top_users: 20,
29 top_drinks_per_user: 4,
30 use_persistence: false,
31 persistence_file_path: String::new(),
32 };
33 }
34}