Skip to content

Commit

Permalink
chore: clippy fixes for rust 1.72 (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 authored and lmondada committed Aug 28, 2023
1 parent 35389cd commit 72316e7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/algorithm/nest_cfgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn all_edges<'a, T: Copy + Clone + PartialEq + Eq + Hash + 'a>(
vec![]
};
cfg.successors(n)
.chain(extra.into_iter())
.chain(extra)
.map(EdgeDest::Forward)
.chain(cfg.predecessors(n).map(EdgeDest::Backward))
.unique()
Expand Down Expand Up @@ -389,7 +389,7 @@ impl<T: Copy + Clone + PartialEq + Eq + Hash> EdgeClassifier<T> {
let highest_target = be_up
.into_iter()
.map(|(dfs, _)| dfs)
.chain(min_dfs_target[0].into_iter());
.chain(min_dfs_target[0]);
(highest_target.min().unwrap_or(usize::MAX), bs)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/builder/build_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ pub trait Dataflow: Container {
just_inputs.into_iter().unzip();
let (rest_types, rest_input_wires): (Vec<Type>, Vec<Wire>) =
inputs_outputs.into_iter().unzip();
input_wires.extend(rest_input_wires.into_iter());
input_wires.extend(rest_input_wires);

let tail_loop = ops::TailLoop {
just_inputs: input_types.into(),
Expand Down
2 changes: 1 addition & 1 deletion src/builder/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl<B: AsMut<Hugr> + AsRef<Hugr>> BlockBuilder<B> {
branch_wire: Wire,
outputs: impl IntoIterator<Item = Wire>,
) -> Result<(), BuildError> {
Dataflow::set_outputs(self, [branch_wire].into_iter().chain(outputs.into_iter()))
Dataflow::set_outputs(self, [branch_wire].into_iter().chain(outputs))
}
fn create(
base: B,
Expand Down
2 changes: 1 addition & 1 deletion src/builder/tail_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<B: AsMut<Hugr> + AsRef<Hugr>> TailLoopBuilder<B> {
out_variant: Wire,
rest: impl IntoIterator<Item = Wire>,
) -> Result<(), BuildError> {
Dataflow::set_outputs(self, [out_variant].into_iter().chain(rest.into_iter()))
Dataflow::set_outputs(self, [out_variant].into_iter().chain(rest))
}

/// Get a reference to the [`ops::TailLoop`]
Expand Down
7 changes: 3 additions & 4 deletions src/ops/controlflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ impl DataflowOpTrait for Conditional {

fn signature(&self) -> FunctionType {
let mut inputs = self.other_inputs.clone();
inputs.to_mut().insert(
0,
Type::new_predicate(self.predicate_inputs.clone().into_iter()),
);
inputs
.to_mut()
.insert(0, Type::new_predicate(self.predicate_inputs.clone()));
FunctionType::new(inputs, self.outputs.clone())
}
}
Expand Down

0 comments on commit 72316e7

Please sign in to comment.