object blacklist, storing second length

This commit is contained in:
Reid 2023-09-05 22:34:00 -07:00
parent 86adf64575
commit be729aa533
Signed by: reidlab
GPG key ID: 6C9EAA3364F962C8
4 changed files with 25 additions and 10 deletions

View file

@ -6,7 +6,8 @@ use std::sync::LazyLock;
pub struct Config {
pub general: ConfigGeneral,
pub accounts: ConfigAccounts,
pub db: ConfigDB
pub db: ConfigDB,
pub levels: ConfigLevels
}
#[derive(Deserialize)]
@ -25,6 +26,11 @@ pub struct ConfigDB {
pub data_folder: String
}
#[derive(Deserialize)]
pub struct ConfigLevels {
pub blocklist: Vec<i32>
}
impl Config {
pub fn load_from_file(file_path: &str) -> Self {
let toml_str = fs::read_to_string(file_path).expect("Error finding toml config:");