Skip to content

Config file

squimmy requested to merge config-file into master

This change moves (most of) the config stuff into config files that are loaded at runtime.

It seems to work okay but there are a couple of problems:

  • I don't like that the contents of the config file are kept around as a separate static string, but it seems like the deserializer expects a string with equivalent lifetime to the value it deserializes to. This strikes me as a little odd. Is there some sort of workaround to this? I glanced over the toml source and it looks like all the deserialization methods have the same lifetime parameters.

  • discord_token is still being loaded at compile time, which sucks. In theory we should be able to load it as a static just like CONFIG_FILE, but I get a confusing type-error when I try that, so maybe someone who knows more about rust can help me out there.

Merge request reports