Skip to content

Commit fd95a52

Browse files
committed
clippy
1 parent 23d85e5 commit fd95a52

File tree

14 files changed

+20
-25
lines changed

14 files changed

+20
-25
lines changed

server/src/ability_initializer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::card::HandCard;
2-
use crate::combat::{update_combat_strength, Combat};
2+
use crate::combat::{update_combat_strength, Combat};
33
use crate::combat_listeners::CombatStrength;
44
use crate::content::custom_phase_actions::{
55
AdvanceRequest, CurrentEventHandler, CurrentEventRequest, CurrentEventResponse,

server/src/combat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub(crate) fn update_combat_strength(
223223
game: &mut Game,
224224
player: usize,
225225
e: &mut CombatRoundStart,
226-
update: impl Fn(&mut Game, &Combat, &mut CombatStrength, CombatRole) + Clone + Sized,
226+
update: impl Fn(&mut Game, &Combat, &mut CombatStrength, CombatRole) + Clone,
227227
) {
228228
if player == e.combat.attacker {
229229
update(

server/src/combat_listeners.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::ability_initializer::AbilityInitializerSetup;
2-
use crate::combat::{capture_position, Combat, CombatRetreatState};
2+
use crate::combat::{capture_position, Combat, CombatRetreatState};
33
use crate::consts::SHIP_CAPACITY;
44
use crate::content::builtin::{Builtin, BuiltinBuilder};
55
use crate::content::custom_phase_actions::{new_position_request, CurrentEventType, UnitsRequest};
@@ -371,10 +371,7 @@ pub(crate) fn event_with_tactics<T: Clone + PartialEq>(
371371
),
372372
CombatRoundType::Done => panic!("Invalid round type"),
373373
};
374-
s = match option {
375-
None => return None,
376-
Some(e) => e,
377-
}
374+
s = option?;
378375
}
379376
*get_round_type(&mut s) = CombatRoundType::Done;
380377
Some(s)
@@ -463,8 +460,7 @@ pub(crate) fn offer_retreat() -> Builtin {
463460
game.add_info_log_item(&format!("{player_name} does not retreat",));
464461
}
465462
if retreat.choice {
466-
e.combat.retreat =
467-
CombatRetreatState::EndAfterCurrentRound;
463+
e.combat.retreat = CombatRetreatState::EndAfterCurrentRound;
468464
}
469465
},
470466
)

server/src/content/advances/economy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn trade_routes() -> AdvanceBuilder {
7474
)
7575
})
7676
},
77-
|game, p, _| {
77+
|game, p, ()| {
7878
let (_, routes) =
7979
trade_route_reward(game).expect("No trade route reward");
8080
trade_route_log(game, p.player_index, &routes, &p.choice, p.actively_selected)

server/src/content/advances/warfare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::city_pieces::Building::Fortress;
55
use crate::combat::CombatModifier::{
66
CancelFortressExtraDie, CancelFortressIgnoreHit, SteelWeaponsAttacker, SteelWeaponsDefender,
77
};
8-
use crate::combat::{ Combat, CombatModifier};
8+
use crate::combat::{Combat, CombatModifier};
99
use crate::combat_listeners::CombatStrength;
1010
use crate::content::advances::{
1111
advance_group_builder, AdvanceGroup, METALLURGY, STEEL_WEAPONS, TACTICS,

server/src/content/custom_phase_actions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl CurrentEventState {
217217
selected_position: None,
218218
}
219219
}
220-
220+
221221
#[must_use]
222222
pub fn active_player(&self) -> Option<&usize> {
223223
self.players_used.first()

server/src/content/incidents/earthquake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::content::custom_phase_actions::{
99
use crate::content::wonders::get_wonder;
1010
use crate::game::Game;
1111
use crate::incident::{Incident, IncidentBaseEffect, MoodModifier};
12-
use crate::player_events::{IncidentInfo, IncidentTarget};
12+
use crate::player_events::IncidentTarget;
1313
use crate::position::Position;
1414
use itertools::Itertools;
1515

server/src/content/incidents/famine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::content::custom_phase_actions::UnitsRequest;
55
use crate::game::Game;
66
use crate::incident::{Incident, IncidentBaseEffect, MoodModifier, PermanentIncidentEffect};
77
use crate::player::Player;
8-
use crate::player_events::{IncidentInfo, IncidentTarget};
8+
use crate::player_events::IncidentTarget;
99
use crate::playing_actions::PlayingActionType;
1010
use crate::position::Position;
1111
use crate::resource_pile::ResourcePile;

server/src/content/incidents/trade.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ fn reformation() -> Incident {
196196
))
197197
},
198198
|game, s| {
199-
let &p = game.current_event().active_player().expect("should have active player");
199+
let &p = game
200+
.current_event()
201+
.active_player()
202+
.expect("should have active player");
200203
let donor = game.get_player_mut(p);
201204
let pos = s.choice[0];
202205
donor

server/src/content/incidents/trojan.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use crate::ability_initializer::AbilityInitializerSetup;
2-
use crate::combat::{
3-
Combat, CombatModifier, CombatRetreatState,
4-
};
2+
use crate::combat::{Combat, CombatModifier, CombatRetreatState};
53
use crate::combat_listeners::CombatResult;
64
use crate::content::advances::get_advance;
75
use crate::content::builtin::Builtin;
@@ -68,9 +66,7 @@ pub(crate) fn decide_trojan_horse() -> Builtin {
6866
));
6967
game.permanent_incident_effects
7068
.retain(|e| !matches!(e, PermanentIncidentEffect::TrojanHorse));
71-
c
72-
.modifiers
73-
.push(CombatModifier::TrojanHorse);
69+
c.modifiers.push(CombatModifier::TrojanHorse);
7470
}
7571
},
7672
)

0 commit comments

Comments
 (0)