Skip to content

Commit eaba3fc

Browse files
clippy fix
1 parent 7f8c5d3 commit eaba3fc

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

examples/schedule_graph_testing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ fn print_schedule(schedule: &Schedule, schedule_label: &dyn ScheduleLabel) {
7979
}
8080
};
8181

82-
println!("{:?}", schedule_label);
82+
println!("{schedule_label:?}");
8383

8484
println!("- SETS");
8585
for (_set_id, set, _conditions) in graph.system_sets() {
86-
println!(" - {:?}", set);
86+
println!(" - {set:?}");
8787
}
8888

8989
println!("- SYSTEMS");

src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ fn execute_cli(app: &mut App) -> Result<Args> {
142142
let write = |out: &str| -> Result<()> {
143143
match &args.out_path {
144144
None => {
145-
println!("{}", out);
145+
println!("{out}");
146146
Ok(())
147147
}
148148
Some(path) => {
149149
let mut out_file = File::create(path)?;
150-
write!(out_file, "{}", out)?;
150+
write!(out_file, "{out}")?;
151151
Ok(())
152152
}
153153
}

src/dot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn format_attributes(attrs: &[(&str, &str)]) -> String {
3737
.map(|(a, b)| format!("{}={}", escape_id(a), escape_id(b)))
3838
.collect();
3939
let attrs = attrs.join(", ");
40-
format!("[{}]", attrs)
40+
format!("[{attrs}]")
4141
}
4242
pub fn font_tag(text: &str, color: &str, size: u8) -> String {
4343
if text.is_empty() {
@@ -78,7 +78,7 @@ impl DotGraph {
7878
DotGraph::new(name, "digraph", options)
7979
}
8080
pub fn subgraph(name: &str, options: &[(&str, &str)]) -> DotGraph {
81-
DotGraph::new(&format!("cluster{}", name), "subgraph", options)
81+
DotGraph::new(&format!("cluster{name}"), "subgraph", options)
8282
}
8383

8484
#[allow(dead_code)]

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn schedule_graph_dot(
2727
.resource_scope::<Schedules, _>(|world, mut schedules| {
2828
let ignored_ambiguities = schedules.ignored_scheduling_ambiguities.clone();
2929

30-
let label_name = format!("{:?}", label);
30+
let label_name = format!("{label:?}");
3131
let schedule = schedules
3232
.get_mut(label)
3333
.ok_or_else(|| format!("schedule {label_name} doesn't exist"))

src/render_graph/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn build_dot_graph(
3434
settings: &Settings,
3535
subgraph_nest_level: usize,
3636
) {
37-
let fmt_label = |label: Interned<dyn RenderLabel>| format!("{:?}", label);
37+
let fmt_label = |label: Interned<dyn RenderLabel>| format!("{label:?}");
3838

3939
let node_mapping: HashMap<_, _> = graph
4040
.iter_nodes()
@@ -62,11 +62,11 @@ fn build_dot_graph(
6262
let next_layer_style =
6363
&settings.style.layers[(subgraph_nest_level + 1) % settings.style.layers.len()];
6464

65-
for (name, subgraph) in sorted(graph.iter_sub_graphs(), |(name, _)| format!("{:?}", name)) {
65+
for (name, subgraph) in sorted(graph.iter_sub_graphs(), |(name, _)| format!("{name:?}")) {
6666
let internal_name = format!("{}_{:?}", graph_name.unwrap_or_default(), name);
6767
let mut sub_dot = DotGraph::subgraph(
6868
&internal_name,
69-
&[("label", &format!("{:?}", name)), ("fontcolor", "red")],
69+
&[("label", &format!("{name:?}")), ("fontcolor", "red")],
7070
)
7171
.graph_attributes(&[
7272
("style", "rounded,filled"),
@@ -94,7 +94,7 @@ fn build_dot_graph(
9494
.map(|(index, slot)| {
9595
format!(
9696
"<TD PORT=\"{}\">{}: {}</TD>",
97-
html_escape(&format!("in-{}", index)),
97+
html_escape(&format!("in-{index}")),
9898
html_escape(&slot.name),
9999
html_escape(&format!("{:?}", slot.slot_type))
100100
)
@@ -108,7 +108,7 @@ fn build_dot_graph(
108108
.map(|(index, slot)| {
109109
format!(
110110
"<TD PORT=\"{}\">{}: {}</TD>",
111-
html_escape(&format!("out-{}", index)),
111+
html_escape(&format!("out-{index}")),
112112
html_escape(&slot.name),
113113
html_escape(&format!("{:?}", slot.slot_type))
114114
)
@@ -117,12 +117,12 @@ fn build_dot_graph(
117117

118118
let slots = iter_utils::zip_longest(inputs.iter(), outputs.iter())
119119
.map(|pair| match pair {
120-
EitherOrBoth::Both(input, output) => format!("<TR>{}{}</TR>", input, output),
120+
EitherOrBoth::Both(input, output) => format!("<TR>{input}{output}</TR>"),
121121
EitherOrBoth::Left(input) => {
122-
format!("<TR>{}<TD BORDER=\"0\">&nbsp;</TD></TR>", input)
122+
format!("<TR>{input}<TD BORDER=\"0\">&nbsp;</TD></TR>")
123123
}
124124
EitherOrBoth::Right(output) => {
125-
format!("<TR><TD BORDER=\"0\">&nbsp;</TD>{}</TR>", output)
125+
format!("<TR><TD BORDER=\"0\">&nbsp;</TD>{output}</TR>")
126126
}
127127
})
128128
.collect::<String>();
@@ -155,9 +155,9 @@ fn build_dot_graph(
155155
} => {
156156
dot.add_edge_with_ports(
157157
&node_id(output_node),
158-
Some(&format!("out-{}:e", output_index)),
158+
Some(&format!("out-{output_index}:e")),
159159
&node_id(input_node),
160-
Some(&format!("in-{}:w", input_index)),
160+
Some(&format!("in-{input_index}:w")),
161161
&[("color", &layer_style.color_edge_slot)],
162162
);
163163
}

src/schedule_graph/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,11 +652,11 @@ fn set_cluster_name(id: NodeId) -> String {
652652
}
653653

654654
fn node_index_name(node_id: NodeId) -> String {
655-
format!("node_{:?}", node_id)
655+
format!("node_{node_id:?}")
656656
}
657657
fn marker_name(node_id: NodeId) -> String {
658658
assert!(node_id.is_set());
659-
format!("set_marker_node_{:?}", node_id)
659+
format!("set_marker_node_{node_id:?}")
660660
}
661661

662662
enum IterSingleResult<T> {
@@ -774,7 +774,7 @@ fn remove_transitive_edges(graph: &mut DiGraph) {
774774
graph.remove_edge(visiting, n);
775775

776776
reachable.clear();
777-
collect_reachable(&mut reachable, &graph, visiting, Direction::Outgoing);
777+
collect_reachable(&mut reachable, graph, visiting, Direction::Outgoing);
778778

779779
// if we still can access a neighbour with a longer path, it's a transitive dependency.
780780
if !reachable.contains(&n) {

src/schedule_graph/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,5 +320,5 @@ pub fn full_system_name(system: &ScheduleSystem) -> String {
320320
}
321321

322322
pub fn default_system_set_name(system_set: &dyn SystemSet) -> String {
323-
format!("{:?}", system_set)
323+
format!("{system_set:?}")
324324
}

0 commit comments

Comments
 (0)