Did we not want to use `file::each_line` here?  Shouldn't really make a difference if the config file is small, but passing a lambda that sets `mode` and `type` based on a matched line would also work.