Skip to content

Commit

Permalink
chore: Fix new lints in Rust 1.83 (#706)
Browse files Browse the repository at this point in the history
drive-by: Update uv lock
  • Loading branch information
aborgna-q authored Nov 28, 2024
1 parent e6a27b2 commit 92cb943
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tket2-hseries/src/extension/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl HasConcrete for FutureOpDef {
}
}

impl<'a> From<&'a FutureOp> for &'static str {
impl From<&FutureOp> for &'static str {
fn from(value: &FutureOp) -> Self {
value.op.into()
}
Expand Down
2 changes: 1 addition & 1 deletion tket2-hseries/src/extension/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ fn concrete_result_op_type_args(
}
}

impl<'a> From<&'a ResultOp> for &'static str {
impl From<&ResultOp> for &'static str {
fn from(value: &ResultOp) -> Self {
value.result_op.into()
}
Expand Down
2 changes: 1 addition & 1 deletion tket2-py/examples/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def guppy_to_circuit(func_def: RawFunctionDef) -> Tk2Circuit:

pkg = module.compile()

json = pkg.to_json()
json = pkg.package.to_json()
circ = Tk2Circuit.from_package_json(json, func_def.name)

return lower_to_pytket(circ)
16 changes: 8 additions & 8 deletions tket2/src/circuit/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl<'circ, T: HugrView> Command<'circ, T> {
}
}

impl<'a, 'circ, T: HugrView> UnitLabeller for &'a Command<'circ, T> {
impl<T: HugrView> UnitLabeller for &Command<'_, T> {
#[inline]
fn assign_linear(&self, _: Node, port: Port, _linear_count: usize) -> LinearUnit {
let units = match port.direction() {
Expand All @@ -190,7 +190,7 @@ impl<'a, 'circ, T: HugrView> UnitLabeller for &'a Command<'circ, T> {
}
}

impl<'circ, T: HugrView> std::fmt::Debug for Command<'circ, T> {
impl<T: HugrView> std::fmt::Debug for Command<'_, T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Command")
.field("circuit name", &self.circ.name())
Expand All @@ -201,17 +201,17 @@ impl<'circ, T: HugrView> std::fmt::Debug for Command<'circ, T> {
}
}

impl<'circ, T: HugrView> PartialEq for Command<'circ, T> {
impl<T: HugrView> PartialEq for Command<'_, T> {
fn eq(&self, other: &Self) -> bool {
self.node == other.node
&& self.input_linear_units == other.input_linear_units
&& self.output_linear_units == other.output_linear_units
}
}

impl<'circ, T: HugrView> Eq for Command<'circ, T> {}
impl<T: HugrView> Eq for Command<'_, T> {}

impl<'circ, T: HugrView> Clone for Command<'circ, T> {
impl<T: HugrView> Clone for Command<'_, T> {
fn clone(&self) -> Self {
Self {
circ: self.circ,
Expand All @@ -222,7 +222,7 @@ impl<'circ, T: HugrView> Clone for Command<'circ, T> {
}
}

impl<'circ, T: HugrView> std::hash::Hash for Command<'circ, T> {
impl<T: HugrView> std::hash::Hash for Command<'_, T> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.node.hash(state);
self.input_linear_units.hash(state);
Expand Down Expand Up @@ -460,9 +460,9 @@ impl<'circ, T: HugrView> Iterator for CommandIterator<'circ, T> {
}
}

impl<'circ, T: HugrView> FusedIterator for CommandIterator<'circ, T> {}
impl<T: HugrView> FusedIterator for CommandIterator<'_, T> {}

impl<'circ, T: HugrView> std::fmt::Debug for CommandIterator<'circ, T> {
impl<T: HugrView> std::fmt::Debug for CommandIterator<'_, T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CommandIterator")
.field("circuit name", &self.circ.name())
Expand Down
2 changes: 1 addition & 1 deletion tket2/src/optimiser/badger/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct BadgerLogger<'w> {
branching_factor: UsizeAverage,
}

impl<'w> Default for BadgerLogger<'w> {
impl Default for BadgerLogger<'_> {
fn default() -> Self {
Self {
circ_candidates_csv: Default::default(),
Expand Down
1 change: 1 addition & 0 deletions tket2/tests/badger_termination.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Tests for the Badger optimiser termination conditions.
#![cfg(feature = "portmatching")]

use rstest::{fixture, rstest};
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 92cb943

Please sign in to comment.