From 56e68b3cf5833b405d489bcc12be92da01233e29 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Sat, 13 Apr 2019 21:37:30 +0200 Subject: Made code more idiomatic --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index fce9cf6..37c68c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -134,14 +134,14 @@ fn main() { )) .bold() )); - let random_route = miniserve_config.clone().random_route; - if random_route.is_some() { + + if let Some(random_route) = miniserve_config.clone().random_route { addresses.push_str(&format!( "{}", Color::Green .paint(format!( "/{random_route}", - random_route = random_route.unwrap(), + random_route = random_route, )) .bold() )); -- cgit v1.2.3 From e900dba1aaf8f169b91f2b3c5abc711109e25e35 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Sat, 13 Apr 2019 21:44:45 +0200 Subject: Cargo fmt --- src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 37c68c9..2a43780 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,10 +139,7 @@ fn main() { addresses.push_str(&format!( "{}", Color::Green - .paint(format!( - "/{random_route}", - random_route = random_route, - )) + .paint(format!("/{random_route}", random_route = random_route,)) .bold() )); } -- cgit v1.2.3