From 11e64fc7560de3cd0def718edf68c31e3dc8be72 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Wed, 4 Sep 2024 15:08:55 +0200 Subject: move stuff around, remove lib.rs for overview --- src/data/list.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/data/list.rs (limited to 'src/data/list.rs') diff --git a/src/data/list.rs b/src/data/list.rs new file mode 100644 index 0000000..0045b7a --- /dev/null +++ b/src/data/list.rs @@ -0,0 +1,19 @@ +use crate::{config::Cfg, db::{config_get_current_list, lists_get}, error::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 { + let id = config_get_current_list(config)?; + lists_get(config, &id) + } +} -- cgit v1.2.3