aboutsummaryrefslogtreecommitdiff
path: root/src/cache.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache.gleam')
-rw-r--r--src/cache.gleam4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cache.gleam b/src/cache.gleam
index 7e4ff21..7cd40a5 100644
--- a/src/cache.gleam
+++ b/src/cache.gleam
@@ -2,7 +2,6 @@ import gleam/bit_array
import gleam/dict.{type Dict}
import gleam/int
import gleam/list
-import gleam/option.{type Option}
import gleam/result
import gleam/string
import image
@@ -85,8 +84,7 @@ fn load_cached_image(path) {
}
}
-pub fn get_image(cache, theme, digit) -> Option(CachedImage) {
+pub fn get_image(cache, theme, digit) -> Result(CachedImage, Nil) {
dict.get(cache, theme)
|> result.then(fn(theme_images) { dict.get(theme_images, digit) })
- |> option.from_result
}