From 8938e627c04c01f8f30a854be6903a9abcd2fa5b Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 26 Jan 2018 10:51:49 +0700 Subject: Fix build with new Toml module version. I have no idea where TomlLenses module is gone but frankly the whole thing is a lot less pretty without it. --- src/vyconf_config.ml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/vyconf_config.ml b/src/vyconf_config.ml index 7a87c1a..b7d1352 100644 --- a/src/vyconf_config.ml +++ b/src/vyconf_config.ml @@ -34,10 +34,9 @@ let empty_config = { (* XXX: We assume that nesting in TOML config files never goes beyond two levels *) let get_field conf tbl_name field_name = - (* NB: TomlLenses module uses "table" and "field" names for function names, - hence tbl_name and field_name - *) - TomlLenses.(get conf (key tbl_name |-- table |-- key field_name |-- string)) + try + Some (Toml.get_string (Toml.key field_name) (Toml.get_table (Toml.key tbl_name) conf)) + with Not_found -> None let mandatory_field conf table field = let value = get_field conf table field in @@ -52,7 +51,7 @@ let optional_field default conf table field = let load filename = try let open Defaults in - let conf_toml = Toml.Parser.from_filename filename |> Toml.Parser.unsafe in + let conf_toml = Toml.Parser.from_filename filename in let conf = empty_config in (* Mandatory fields *) let conf = {conf with app_name = mandatory_field conf_toml "appliance" "name"} in -- cgit v1.2.3