chiark / gitweb /
wip join-game etc., experiencing toml bug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 17 Nov 2020 17:57:52 +0000 (17:57 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 17 Nov 2020 17:57:52 +0000 (17:57 +0000)
    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 <ijackson@chiark.greenend.org.uk>
demo/test.table.toml
src/config.rs

index b67890d8650b6bdc67c5a9b088463370d5a3d0a4..ed537087f5f0c273cf12442d46e8c94ff228215b 100644 (file)
@@ -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"
index 9a623b0e96eb42f39381b0d2b01114c371a88346..3f5c45142624fa10ae80dea1309b5f492e6cd181 100644 (file)
@@ -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")
   }
 }