summary refs log tree commit diff
path: root/src/config.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/config.zig b/src/config.zig
index 49c6dad..2ecb69b 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -24,6 +24,7 @@ const ini = @import("ini");
 const join = std.fs.path.join;
 const mkdir = std.os.mkdir;
 const openFile = std.fs.openFileAbsolute;
+const parseBool = @import("misc.zig").parseBool;
 const parseFloat = std.fmt.parseFloat;
 const parseInt = std.fmt.parseInt;
 const std = @import("std");
@@ -44,15 +45,6 @@ pub const Config = extern struct {
     debug: bool = false,
 };
 
-/// Parse boolean values.
-fn parseBool(s: []const u8) !bool {
-    if (eql(u8, s, "false"))
-        return false;
-    if (eql(u8, s, "true"))
-        return true;
-    return error.InvalidCharacter;
-}
-
 /// Parse config.ini in the given base directory.
 pub fn parse(allocator: *Allocator, base_dir: []const u8) !Config {
     const config_dir = try join(allocator, &.{ base_dir, "blackshades" });