From 96a70d760ce351a66d3e1fb3b85ffe7f083abc71 Mon Sep 17 00:00:00 2001 From: Isse Date: Mon, 6 Nov 2023 07:30:36 +0100 Subject: [PATCH] clippyyyyy --- rtsim/src/rule/npc_ai.rs | 8 +++++--- world/src/site2/plot/tavern.rs | 8 +++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rtsim/src/rule/npc_ai.rs b/rtsim/src/rule/npc_ai.rs index 41bea4d61d..eedc7796c3 100644 --- a/rtsim/src/rule/npc_ai.rs +++ b/rtsim/src/rule/npc_ai.rs @@ -325,7 +325,9 @@ impl Rule for NpcAi { } } -fn idle() -> impl Action + Clone { just(|ctx, _| ctx.controller.do_idle()).debug(|| "idle") } +fn idle() -> impl Action + Clone { + just(|ctx, _| ctx.controller.do_idle()).debug(|| "idle") +} /// Try to walk toward a 3D position without caring for obstacles. fn goto(wpos: Vec3, speed_factor: f32, goal_dist: f32) -> impl Action { @@ -914,9 +916,9 @@ fn villager(visiting_site: SiteId) -> impl Action { _ => None, }) ).choose(&mut ctx.rng).unwrap_or(stage_aabr.center().with_z(stage_z)); - + // Pick a chair that is theirs for the stay - let chair_pos = tavern.rooms.values().flat_map(|room| { + let chair_pos = tavern.rooms.values().flat_map(|room| { let z = room.bounds.min.z; room.details.iter().filter_map(move |detail| match detail { tavern::Detail::Table { pos, chairs } => Some(chairs.into_iter().map(move |dir| pos.with_z(z) + dir.to_vec2())), diff --git a/world/src/site2/plot/tavern.rs b/world/src/site2/plot/tavern.rs index 46b2515a2b..eab8b081e3 100644 --- a/world/src/site2/plot/tavern.rs +++ b/world/src/site2/plot/tavern.rs @@ -302,7 +302,7 @@ impl Tavern { min: aabr.min - amount, max: aabr.max + amount, }; - 'room_gen: while room_metas.len() > 0 { + 'room_gen: while !room_metas.is_empty() { // Continue extending from a random existing room let mut room_meta = room_metas.swap_remove(rng.gen_range(0..room_metas.len())); if room_meta.walls.is_empty() { @@ -683,10 +683,8 @@ impl Tavern { continue 'y_loop; } - if contains_x && min.y < area.min.y { - if area.min.y - 1 < max_y { - max_y = area.min.y - 1; - } + if contains_x && min.y < area.min.y && area.min.y - 1 < max_y { + max_y = area.min.y - 1; } }