aboutsummaryrefslogtreecommitdiff
path: root/aoc2023/build/packages/adglent/src/priv/toml.gleam
diff options
context:
space:
mode:
authorH.J <thechairman@thechairman.info>2024-10-09 11:35:09 -0400
committerH.J <thechairman@thechairman.info>2024-10-09 11:35:09 -0400
commit6156a9ef7be4012063a042aafb4e9b0d7eadde8e (patch)
tree5d990ded3baba51ca3934b51994285f7d5915c34 /aoc2023/build/packages/adglent/src/priv/toml.gleam
parentef2ad0ee020b6754c230ae08f5979948b8db1350 (diff)
downloadgleam_aoc-6156a9ef7be4012063a042aafb4e9b0d7eadde8e.tar.gz
gleam_aoc-6156a9ef7be4012063a042aafb4e9b0d7eadde8e.zip
cleanup
Diffstat (limited to 'aoc2023/build/packages/adglent/src/priv/toml.gleam')
-rw-r--r--aoc2023/build/packages/adglent/src/priv/toml.gleam52
1 files changed, 0 insertions, 52 deletions
diff --git a/aoc2023/build/packages/adglent/src/priv/toml.gleam b/aoc2023/build/packages/adglent/src/priv/toml.gleam
deleted file mode 100644
index 7042833..0000000
--- a/aoc2023/build/packages/adglent/src/priv/toml.gleam
+++ /dev/null
@@ -1,52 +0,0 @@
-import tom
-import gleam/result
-
-pub type TomError {
- TomParseError(error: tom.ParseError)
- TomGetError(error: tom.GetError)
-}
-
-pub fn get_string(
- toml_content: String,
- key_path: List(String),
-) -> Result(String, TomError) {
- use toml <- result.try(
- tom.parse(toml_content <> "\n")
- |> result.map_error(TomParseError),
- )
- use value <- result.try(
- tom.get_string(toml, key_path)
- |> result.map_error(TomGetError),
- )
- Ok(value)
-}
-
-pub fn get_bool(
- toml_content: String,
- key_path: List(String),
-) -> Result(Bool, TomError) {
- use toml <- result.try(
- tom.parse(toml_content <> "\n")
- |> result.map_error(TomParseError),
- )
- use value <- result.try(
- tom.get_bool(toml, key_path)
- |> result.map_error(TomGetError),
- )
- Ok(value)
-}
-
-pub fn get_int(
- toml_content: String,
- key_path: List(String),
-) -> Result(Int, TomError) {
- use toml <- result.try(
- tom.parse(toml_content <> "\n")
- |> result.map_error(TomParseError),
- )
- use value <- result.try(
- tom.get_int(toml, key_path)
- |> result.map_error(TomGetError),
- )
- Ok(value)
-}