Skip to content

Commit

Permalink
chore: satisfy cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
antalsz committed Jan 9, 2025
1 parent 79814db commit 810bcce
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion quil-rs/src/parser/lexer/wrapped_parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ where
/// what tag string was expected.
pub(crate) fn tag<'a>(
lit: &'static str,
) -> impl FnMut(LexInput<'a>) -> InternalLexResult<LexInput<'a>> {
) -> impl FnMut(LexInput<'a>) -> InternalLexResult<'a, LexInput<'a>> {
move |input| {
map_err(nom_tag(lit), |err: nom::error::Error<LexInput<'a>>| {
InternalLexError::from_kind(err.input, LexErrorKind::ExpectedString(lit))
Expand Down
2 changes: 1 addition & 1 deletion quil-rs/src/parser/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl nom::InputLength for TokenWithLocation<'_> {
/// Wraps a parser that returns a [`Token`] and combines it with file location information.
pub(crate) fn token_with_location<'i, E, P>(
mut parser: P,
) -> impl FnMut(LexInput<'i>) -> LexResult<'i, TokenWithLocation, E>
) -> impl FnMut(LexInput<'i>) -> LexResult<'i, TokenWithLocation<'i>, E>
where
P: nom::Parser<LexInput<'i>, Token, E>,
E: nom::error::ParseError<LexInput<'i>>,
Expand Down
2 changes: 1 addition & 1 deletion quil-rs/src/program/analysis/control_flow_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ pub enum BasicBlockTerminatorOwned {
Halt,
}

impl<'p> From<BasicBlockTerminator<'p>> for BasicBlockTerminatorOwned {
impl From<BasicBlockTerminator<'_>> for BasicBlockTerminatorOwned {
fn from(value: BasicBlockTerminator) -> Self {
match value {
BasicBlockTerminator::ConditionalJump {
Expand Down
4 changes: 2 additions & 2 deletions quil-rs/src/program/scheduling/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ impl<'a> ScheduledBasicBlock<'a> {
&self.graph
}

pub fn instructions(&'a self) -> &[&'a Instruction] {
pub fn instructions(&'a self) -> &'a [&'a Instruction] {
self.basic_block.instructions()
}

Expand Down Expand Up @@ -538,7 +538,7 @@ impl<'a> From<&'a ScheduledBasicBlockOwned> for ScheduledBasicBlock<'a> {
}
}

impl<'a> From<ScheduledBasicBlock<'a>> for ScheduledBasicBlockOwned {
impl From<ScheduledBasicBlock<'_>> for ScheduledBasicBlockOwned {
fn from(block: ScheduledBasicBlock) -> Self {
Self {
basic_block: block.basic_block.into(),
Expand Down
6 changes: 3 additions & 3 deletions quil-rs/src/program/scheduling/graphviz_dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::{

use super::graph::ScheduledProgram;

impl<'a> ScheduledBasicBlock<'a> {
impl ScheduledBasicBlock<'_> {
/// Given a [`dot_writer::Scope`] representing a subgraph/cluster, write the timing graph for this block into it.
/// Uses the `node_prefix` argument for namespacing so that node IDs remain unique within the overall graph.
fn write_dot_format(&self, cluster: &mut dot_writer::Scope, node_prefix: &str) {
Expand Down Expand Up @@ -108,7 +108,7 @@ impl<'p> From<&'p Target> for DotFormatBlockLabel<'p> {
}
}

impl<'p> From<usize> for DotFormatBlockLabel<'p> {
impl From<usize> for DotFormatBlockLabel<'_> {
fn from(index: usize) -> Self {
DotFormatBlockLabel::Unlabeled { index }
}
Expand All @@ -123,7 +123,7 @@ impl std::fmt::Display for DotFormatBlockLabel<'_> {
}
}

impl<'a> ScheduledProgram<'a> {
impl ScheduledProgram<'_> {
/// Return a DOT format string (as bytes) for use with Graphviz.
///
/// This outputs a `digraph` object with a `subgraph` for each block to inform the layout engine.
Expand Down

0 comments on commit 810bcce

Please sign in to comment.