From: Ian Jackson Date: Tue, 17 Nov 2020 17:57:52 +0000 (+0000) Subject: wip join-game etc., experiencing toml bug X-Git-Tag: otter-0.2.0~502 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b17991bbc30334937d77fe1538d46638b274aa2f;p=otter.git wip join-game etc., experiencing toml bug 1: enum table must contain exactly one table for key `players` at line 1 column 1', src/bin/otter.rs:304:25 https://github.com/alexcrichton/toml-rs/issues/410 Signed-off-by: Ian Jackson --- diff --git a/demo/test.table.toml b/demo/test.table.toml index b67890d8..ed537087 100644 --- a/demo/test.table.toml +++ b/demo/test.table.toml @@ -4,12 +4,16 @@ timezone = "Europe/London" -[[players]] -nick = "alice" -access = "FixedToken" -token = "kmqAKPwK4TfReFjMor8MJhdRPBcwIBpe" +#players = [ { account_glob = "server:*" } ] [[players]] -nick = "bob" -access = "FixedToken" -token = "ccg9kzoTh758QrVE1xMY7BQWB36dNJTx" +account_glob = "server:*" + +#nick = "alice" +#access = "FixedToken" +#token = "kmqAKPwK4TfReFjMor8MJhdRPBcwIBpe" + +#[[players]] +#nick = "bob" +#access = "FixedToken" +#token = "ccg9kzoTh758QrVE1xMY7BQWB36dNJTx" diff --git a/src/config.rs b/src/config.rs index 9a623b0e..3f5c4514 100644 --- a/src/config.rs +++ b/src/config.rs @@ -125,8 +125,10 @@ impl ServerConfig { impl Default for ServerConfig { fn default() -> ServerConfig { - let spec : ServerConfigSpec = toml::de::from_str("") - .expect("parse empty string as ServerConfigSpec"); + let spec : ServerConfigSpec = toml::de::from_str(r#" + public_url = "XXX" + "#) + .expect("parse dummy config as ServerConfigSpec"); spec.try_into().expect("empty spec into config") } }