Skip to content

Commit 38f5f06

Browse files
kkysenPeter Faith Boyland
authored and
Peter Faith Boyland
committed
Reformatted as that's now in CI.
1 parent ba88c60 commit 38f5f06

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

pdg/src/info.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::graph::{Graph, GraphId, Graphs, Node, NodeId, NodeKind};
2+
use itertools::Itertools;
23
use rustc_index::vec::IndexVec;
34
use rustc_middle::mir::Field;
45
use std::collections::HashMap;
56
use std::collections::HashSet;
67
use std::cmp;
7-
use itertools::Itertools;
88
use std::fmt::{self, Debug, Display, Formatter};
99

1010
/// The information checked in this struct is whether nodes flow to loads, stores, and offsets (pos
@@ -161,10 +161,11 @@ impl Display for NodeInfo {
161161
("+offset", self.flows_to_neg_offset),
162162
("-offset", self.flows_to_neg_offset),
163163
("non unique by", self.non_unique),
164-
].into_iter()
165-
.filter_map(|(name,node)| Some((name,node?)))
164+
]
165+
.into_iter()
166+
.filter_map(|(name, node)| Some((name, node?)))
166167
.format_with(", ", |(name, node), f| f(&format_args!("{name} {node}")));
167-
write!(f,"{}", s)
168+
write!(f, "{}", s)
168169
}
169170
}
170171

@@ -190,11 +191,12 @@ fn node_does_neg_offset(n: &Node) -> bool {
190191
}
191192

192193
fn add_children_to_vec(g: &Graph, parents: &HashSet<NodeId>, v: &mut Vec<NodeId>) {
193-
v.extend(g.nodes
194-
.iter_enumerated()
195-
.filter_map(|(id,node)| Some((id,node.source?)))
196-
.filter(|(_,src_idx)| parents.contains(src_idx))
197-
.map(|(id,_)| id)
194+
v.extend(
195+
g.nodes
196+
.iter_enumerated()
197+
.filter_map(|(id, node)| Some((id, node.source?)))
198+
.filter(|(_, src_idx)| parents.contains(src_idx))
199+
.map(|(id, _)| id),
198200
);
199201
}
200202

@@ -292,9 +294,9 @@ pub fn check_whether_rules_obeyed(g: &Graph, n: &NodeId) -> Option<NodeId> {
292294
to_view.extend(
293295
g.nodes
294296
.iter_enumerated()
295-
.filter_map(|(id,node)| Some((id,node.source?)))
296-
.filter(|(_,src_idx)| *src_idx == cur_node_id)
297-
.map(|(id,_)| (id,lineage.clone()))
297+
.filter_map(|(id, node)| Some((id, node.source?)))
298+
.filter(|(_, src_idx)| *src_idx == cur_node_id)
299+
.map(|(id, _)| (id, lineage.clone())),
298300
);
299301
}
300302
None

0 commit comments

Comments
 (0)