From 740509000971ac46f1fa31b2b7779a644e25d0f2 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Wed, 24 Jun 2020 12:39:49 +0100 Subject: [PATCH] document this odd if statement --- src/game.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game.rs b/src/game.rs index c8b8818..c52e1fa 100644 --- a/src/game.rs +++ b/src/game.rs @@ -122,6 +122,10 @@ impl Game { let mut name = "".to_string(); + // game names can be empty - so when we strip out the leading whitespace above, + // it means that the first segment might not be the game name. + // so, check if the first segment is actually the next segment of game data + // to avoid setting the game name to "# BITSY VERSION 7.0" or something if segments[0].starts_with("\"\"\"") // multi-line game name ||