From 6a1df72b2a3cfe46a1571a22271d6830cd95a1d7 Mon Sep 17 00:00:00 2001 From: rasul Date: Thu, 30 Apr 2020 20:59:14 -0500 Subject: [PATCH] reorder if and else to make more sense --- src/check.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/check.rs b/src/check.rs index 68e217f..4ede106 100644 --- a/src/check.rs +++ b/src/check.rs @@ -54,10 +54,10 @@ pub fn player_name>(name: S) -> PlayerCheck { } } - if !err_vec.is_empty() { - PlayerCheck::Err(err_vec) - } else { + if err_vec.is_empty() { PlayerCheck::Ok(name.into()) + } else { + PlayerCheck::Err(err_vec) } }