summaryrefslogblamecommitdiff
path: root/src/data/list.rs
blob: b886af13a02071c7902ee857d2dde5cdee508a97 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
                                                                                














                                                        
                                   

     
use crate::{config::Cfg, db::{config_get_current_list, lists_get}, errors::MLE};

use super::modloader::Modloader;

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct List {
    pub id: String,
    pub mc_version: String,
    pub modloader: Modloader,
    pub download_folder: String,
}

impl List {
    /// # Errors
    pub fn get_current_list(config: &Cfg) -> MLE<List> {
        let id = config_get_current_list(config)?;
        Ok(lists_get(config, &id)?)
    }
}