Skip to content

Commit 7402769

Browse files
committed
fix: cargo clippy
1 parent addc97c commit 7402769

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: src/builderv2.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ impl Command for BuildTalkCommand {
5151
}
5252

5353
/// A recursive function that spawns all the nodes from a talk builder and adds them in the given hashmap.
54-
/// It is used as the first pass of the building, so we have all the entities spawned and the build_node entities map filled.
54+
/// It is used as the first pass of the building, so we have all the entities spawned and the `build_node_entities` map filled.
5555
fn spawn_dialogue_entities(
5656
talk_builder: &TalkBuilder<NonEmpty>,
57-
mut build_node_entities: &mut HashMap<BuildNodeId, Entity>,
57+
build_node_entities: &mut HashMap<BuildNodeId, Entity>,
5858
world: &mut World,
5959
) {
6060
for n in talk_builder.queue.iter() {
6161
let e = world.spawn_empty().id();
6262
build_node_entities.insert(n.id.clone(), e);
6363

6464
for (_, inner_builder) in n.choices.iter() {
65-
spawn_dialogue_entities(inner_builder, &mut build_node_entities, world);
65+
spawn_dialogue_entities(inner_builder, build_node_entities, world);
6666
}
6767
}
6868
}
@@ -82,7 +82,7 @@ fn spawn_dialogue_entities(
8282
fn add_relationships(
8383
root: Entity,
8484
talk_builder: TalkBuilder<NonEmpty>,
85-
mut build_node_entities: &mut HashMap<BuildNodeId, Entity>,
85+
build_node_entities: &mut HashMap<BuildNodeId, Entity>,
8686
world: &mut World,
8787
) -> Vec<Entity> {
8888
let mut parent = root;
@@ -129,7 +129,7 @@ fn add_relationships(
129129
choices_texts.push(choice_text);
130130
// recursively spawn the branches
131131
let branch_leaves =
132-
add_relationships(child, inner_builder, &mut build_node_entities, world);
132+
add_relationships(child, inner_builder, build_node_entities, world);
133133
leaves.extend(branch_leaves);
134134
}
135135
// insert the ChoicesTexts component
@@ -141,7 +141,7 @@ fn add_relationships(
141141

142142
// Let's add the extra connections here
143143
process_manual_connections(
144-
&build_node_entities,
144+
build_node_entities,
145145
&build_node.manual_connections,
146146
child,
147147
world,
@@ -160,15 +160,15 @@ fn add_relationships(
160160

161161
/// Connect the node to the given nodes.
162162
fn process_manual_connections(
163-
manual_connections_map: &HashMap<BuildNodeId, Entity>,
163+
build_node_entities: &HashMap<BuildNodeId, Entity>,
164164
manual_connections: &[BuildNodeId],
165165
child: Entity,
166166
world: &mut World,
167167
) {
168168
if !manual_connections.is_empty() {
169169
for input_id in manual_connections {
170170
// get the entity node from the map
171-
let entity_to_connect_to = manual_connections_map.get(input_id);
171+
let entity_to_connect_to = build_node_entities.get(input_id);
172172

173173
// if the node is not present, log a warning and skip it
174174
if entity_to_connect_to.is_none() {

0 commit comments

Comments
 (0)