Skip to content

Commit

Permalink
small serialization style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tails8521 committed Sep 25, 2020
1 parent e559838 commit 0c25a66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/gui_filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl FilterRow {
FilterType::KillerTeamFilter | FilterType::VictimTeamFilter => {
let mut row = Row::new();
row = row.push(Button::new(&mut self.team_button_blu, Text::new("BLU")).on_press(Message::BluTeamClicked(index)).style(
if self.team_button_selected == Team::Blue {
if self.team_button_selected == Team::Blu {
ActiveButtonHighlight::Highlighted
} else {
ActiveButtonHighlight::NotHighlighted
Expand Down Expand Up @@ -336,7 +336,7 @@ impl FilterRow {
KillerTeamFilter {
team: match self.team_button_selected {
Team::Red => Team::Red,
Team::Blue => Team::Blue,
Team::Blu => Team::Blu,
_ => return None,
},
}
Expand All @@ -346,7 +346,7 @@ impl FilterRow {
VictimTeamFilter {
team: match self.team_button_selected {
Team::Red => Team::Red,
Team::Blue => Team::Blue,
Team::Blu => Team::Blu,
_ => return None,
},
}
Expand Down
5 changes: 1 addition & 4 deletions src/heatmap_analyser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ impl ChatMassage {
}

#[derive(Debug, Clone, Serialize, Deserialize, Copy, PartialEq, Eq, Hash, TryFromPrimitive)]
#[serde(rename_all = "lowercase")]
#[repr(u8)]
pub enum Team {
Other = 0,
Spectator = 1,
Red = 2,
Blue = 3,
Blu = 3,
}

impl Team {
Expand Down Expand Up @@ -129,7 +128,6 @@ impl Spawn {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct UserInfo {
pub name: String,
pub user_id: UserId,
Expand Down Expand Up @@ -476,7 +474,6 @@ impl HeatmapAnalyser {
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct HeatmapAnalysis {
pub start_tick: u32,
pub current_tick: u32,
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ impl Application for App {
}
Message::BluTeamClicked(index) => {
let filter_row = &mut self.get_filters_pane_mut().filters[index];
filter_row.team_button_selected = Team::Blue;
filter_row.team_button_selected = Team::Blu;
filter_row.filter = filter_row.try_generate_filter();
self.try_generate_heatmap();
}
Expand Down

0 comments on commit 0c25a66

Please sign in to comment.