From d4b4a1e1b09e401b3f050c51e5858a7ef2e926bf Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <6977238-fiplox@users.noreply.gitlab.com> Date: Thu, 5 Nov 2020 00:34:25 +0100 Subject: [PATCH] fix to the random-world flag --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index c316356..2a9057c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -250,9 +250,9 @@ fn main() -> Result<(), Box> { let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?; let mut robot_pool: Vec = Vec::new(); - let world: world::World = match matches.value_of("random-world") { - None => parse_config(raw_conf, &mut robot_pool)?, - Some(_) => world::random_world(), + let world: world::World = match matches.is_present("random-world") { + false => parse_config(raw_conf, &mut robot_pool)?, + true => world::random_world(), }; let mut hash: HashMap = HashMap::new();