diff options
| author | Fuwn <[email protected]> | 2026-05-27 09:19:25 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-05-27 09:19:25 +0000 |
| commit | 63f5166e3dcba0c884f112848a4a4e7886ca1b99 (patch) | |
| tree | 3e35acf33f435c98dae1f73b73956d71e28ccd43 /src/cache.gleam | |
| parent | build: Replace Earthfile with Dockerfile (diff) | |
| download | mayu-63f5166e3dcba0c884f112848a4a4e7886ca1b99.tar.xz mayu-63f5166e3dcba0c884f112848a4a4e7886ca1b99.zip | |
refactor: Tighten naming, drop dead paths, reject empty names
Diffstat (limited to 'src/cache.gleam')
| -rw-r--r-- | src/cache.gleam | 4 |
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 } |