From db8d89a4d9e9f49a5443ce4b3738f6b754ed33d4 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 22 Mar 2020 05:46:09 -0700 Subject: [PATCH] * rename CharacterState equals() -> same_variant() --- client/src/lib.rs | 2 +- common/src/comp/character_state.rs | 2 +- voxygen/src/scene/figure/mod.rs | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 5912f15674..9d2e4846d2 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -393,7 +393,7 @@ impl Client { { if last_character_states .get(entity) - .map(|l| !client_character_state.equals(&l.0)) + .map(|l| !client_character_state.same_variant(&l.0)) .unwrap_or(true) { let _ = last_character_states diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index a51b3ba808..7a9c08c499 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -111,7 +111,7 @@ impl CharacterState { } /// Compares for shallow equality (does not check internal struct equality) - pub fn equals(&self, other: &Self) -> bool { + pub fn same_variant(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data std::mem::discriminant(self) == std::mem::discriminant(other) } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 0944c8615b..de3fbdb816 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -418,7 +418,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -650,7 +650,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -730,7 +730,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -810,7 +810,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -884,7 +884,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -958,7 +958,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -1032,7 +1032,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -1106,7 +1106,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -1180,7 +1180,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; } @@ -1254,7 +1254,7 @@ impl FigureMgr { _ => continue, }; - if !character.equals(&last_character.0) { + if !character.same_variant(&last_character.0) { state.state_time = 0.0; }