dandels / dmodman

TUI downloader & update checker for Nexusmods.com
MIT License
43 stars 0 forks source link

type error in test #14

Closed schnusch closed 1 year ago

schnusch commented 1 year ago

I am not particularly well-versed in Rust, but I think there might be an unwrap missing:

diff --git a/src/cache/cacheable.rs b/src/cache/cacheable.rs
index ab2b5eb..f0d6508 100644
--- a/src/cache/cacheable.rs
+++ b/src/cache/cacheable.rs
@@ -53,7 +53,7 @@ mod tests {
         println!("{:?}", path);

         let mi: ModInfo = ModInfo::load(path).await?;
-        assert_eq!(mi.name, "Graphic Herbalism - MWSE and OpenMW Edition");
+        assert_eq!(mi.name.unwrap(), "Graphic Herbalism - MWSE and OpenMW Edition");
         Ok(())
     }
dandels commented 1 year ago

Ah, I forgot to run the unit tests for this because the type changed isn't used anywhere in the program. Unwrap is indeed fine here because it's a test. I'll add it.

dandels commented 1 year ago

I pushed the fixed unit test but it's not part of the latest release archive. Does this cause issues for packaging (presumably) when a newer rustc arrives in NixOS later this month?

schnusch commented 1 year ago

I can just use the commit's diff as a patch when packaging.