summaryrefslogtreecommitdiffstats
path: root/src/launcher/jre/manifest.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-22 15:31:52 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-22 15:31:52 -0600
commit08dba4588e93ce338cf01d740bf0923a4f46ade8 (patch)
treef8888fe3eed524330e247669a516b0b206f375ec /src/launcher/jre/manifest.rs
parentwip: jre download stuff (diff)
more jre download stuff
Diffstat (limited to 'src/launcher/jre/manifest.rs')
-rw-r--r--src/launcher/jre/manifest.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/launcher/jre/manifest.rs b/src/launcher/jre/manifest.rs
index ca21a2b..41780d0 100644
--- a/src/launcher/jre/manifest.rs
+++ b/src/launcher/jre/manifest.rs
@@ -1,4 +1,5 @@
use std::collections::HashMap;
+use indexmap::IndexMap;
use serde::Deserialize;
use crate::version::DownloadInfo;
@@ -44,7 +45,21 @@ pub enum JavaRuntimeFile {
}
}
+impl JavaRuntimeFile {
+ pub fn is_file(&self) -> bool {
+ matches!(*self, JavaRuntimeFile::File { .. })
+ }
+
+ pub fn is_directory(&self) -> bool {
+ matches!(*self, JavaRuntimeFile::Directory)
+ }
+
+ pub fn is_link(&self) -> bool {
+ matches!(*self, JavaRuntimeFile::Link { .. })
+ }
+}
+
#[derive(Debug, Deserialize)]
pub struct JavaRuntimeManifest {
- pub files: HashMap<String, JavaRuntimeFile>
+ pub files: IndexMap<String, JavaRuntimeFile>
}