Skip to content

Commit

Permalink
ConfigEntry
Browse files Browse the repository at this point in the history
- Simplified
  • Loading branch information
deavmi committed Nov 5, 2024
1 parent 9a7f5cb commit 399372d
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions source/niknaks/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ public struct ConfigEntry
*/
public static ConfigEntry ofText(string text)
{
ConfigValue tmp;
tmp.text = text;
return ConfigEntry(tmp, type.TEXT);
return ConfigEntry(text);
}

/**
Expand All @@ -193,9 +191,7 @@ public struct ConfigEntry
*/
public static ConfigEntry ofNumeric(size_t i)
{
ConfigValue tmp;
tmp.integer = i;
return ConfigEntry(tmp, type.NUMERIC);
return ConfigEntry(i);
}

/**
Expand All @@ -208,9 +204,7 @@ public struct ConfigEntry
*/
public static ConfigEntry ofFlag(bool flag)
{
ConfigValue tmp;
tmp.flag = flag;
return ConfigEntry(tmp, type.FLAG);
return ConfigEntry(flag);
}

/**
Expand All @@ -223,9 +217,7 @@ public struct ConfigEntry
*/
public static ConfigEntry ofArray(string[] array)
{
ConfigValue tmp;
tmp.textArray = array;
return ConfigEntry(tmp, type.ARRAY);
return ConfigEntry(array);
}

/**
Expand Down

0 comments on commit 399372d

Please sign in to comment.