aatxe / irc

the irc crate – usable, async IRC for Rust
Mozilla Public License 2.0
530 stars 97 forks source link

can't decode json config #63

Closed onelson closed 7 years ago

onelson commented 7 years ago

Not sure what is going wrong here, but when I call Config::load() on a totally non-exotic config file, it panics:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Custom(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }) }', ../src/libcore/result.rs:799

File looks like

{
  "nickname": "omnbot",
  "alt_nicks": ["omnbot_", "omnbot__"],
  "use_ssl": false,
  "port": 6667,
  "server": "irc.freenode.net",
  "channels": ["##omnbot_testing"]
}

and file config.json reports ascii, which should decode as utf-8 just fine as far as I know.

Any idea what's up?

onelson commented 7 years ago

OK, so, (sheepishly) I think this was just bad argument collection on the cli and the path to the file was wrong. Nothing to see here!