From f7a6d2e9c67c1fdf8fc17fa0461a201fd2720537 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 19 Jan 2023 18:37:42 +0100 Subject: input mostly inplemented, mods missing --- src/apis/modrinth.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/apis') diff --git a/src/apis/modrinth.rs b/src/apis/modrinth.rs index 78073e6..9890cf2 100644 --- a/src/apis/modrinth.rs +++ b/src/apis/modrinth.rs @@ -3,7 +3,7 @@ use chrono::{DateTime, FixedOffset}; use reqwest::Client; use serde::Deserialize; -use crate::{Modloader, List}; +use crate::{Modloader, List, error::{MLE, MLError, ErrorType}}; #[derive(Debug, Deserialize, Clone)] pub struct Project { @@ -177,9 +177,9 @@ pub async fn get_raw_versions(api: String, versions: Vec) -> Vec) -> Result> { +pub fn extract_current_version(versions: Vec) -> MLE { match versions.len() { - 0 => Err(Box::new(Error::new(ErrorKind::NotFound, "NO_VERSIONS_AVAILABLE"))), + 0 => Err(MLError::new(ErrorType::ModError, "NO_VERSIONS_AVAILABLE")), 1.. => { let mut times: Vec<(String, DateTime)> = vec![]; for ver in versions { -- cgit v1.2.3