Skip to content

Commit

Permalink
fix some clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Oct 28, 2023
1 parent 3c34c28 commit 3a351d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
10 changes: 5 additions & 5 deletions components/dada-brew/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ impl Scope<'_> {
/// Creates a subscope with the given `cause` that shares the same start block but is now appending
/// to `end_block`. It is your reponsibility to connect `end_block` (or some successor of it) back to
/// `self.end_block` in this subscope.
pub(crate) fn subscope<'s>(
&'s self,
pub(crate) fn subscope(
&self,
end_block: Option<bir::ControlPoint>,
cause: ScopeCause,
) -> Scope<'s> {
) -> Scope<'_> {
Scope {
start_block: self.start_block,
end_block: end_block,
end_block,
cause,
previous: Some(self),
variables: vec![],
Expand Down Expand Up @@ -167,7 +167,7 @@ impl Scope<'_> {
pub(crate) fn push_declared_variables(
&mut self,
vars: &[validated::LocalVariable],
brewery: &mut Brewery<'_>,
brewery: &Brewery<'_>,
) -> VariableMarker {
let marker = self.mark_variables();
for &v in vars {
Expand Down
12 changes: 4 additions & 8 deletions components/dada-execute/src/heap_graph/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ impl HeapGraph {
if let Some(name) = name {
w.permissions
.entry(edge.permission)
.or_insert(vec![])
.or_default()
.push(GraphvizPlace {
node: source.to_string(),
port: index,
Expand Down Expand Up @@ -400,7 +400,7 @@ impl HeapGraph {
///
/// If there is no graph to diff against, return true, as everything
/// is considered to have changed.
fn value_edge_did_change(&self, w: &mut GraphvizWriter<'_>, edge: ValueEdge) -> bool {
fn value_edge_did_change(&self, w: &GraphvizWriter<'_>, edge: ValueEdge) -> bool {
let edge_data = edge.data(&self.tables);

if self.permission_node_did_change(w, edge_data.permission) {
Expand All @@ -414,11 +414,7 @@ impl HeapGraph {
///
/// If there is no graph to diff against, return true, as everything
/// is considered to have changed.
fn value_edge_target_did_change(
&self,
w: &mut GraphvizWriter<'_>,
edge: ValueEdgeTarget,
) -> bool {
fn value_edge_target_did_change(&self, w: &GraphvizWriter<'_>, edge: ValueEdgeTarget) -> bool {
let Some(diff_against) = w.diff_against else {
return true;
};
Expand Down Expand Up @@ -452,7 +448,7 @@ impl HeapGraph {
/// is considered to have changed.
fn permission_node_did_change(
&self,
w: &mut GraphvizWriter<'_>,
w: &GraphvizWriter<'_>,
permission: PermissionNode,
) -> bool {
let Some(diff_against) = w.diff_against else {
Expand Down
8 changes: 4 additions & 4 deletions components/dada-execute/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@ impl ProgramCounter {
/// True if this PC represents a `return` terminator.
pub fn is_return(&self, db: &dyn crate::Db) -> bool {
let bir_data = self.bir.data(db);
match &bir_data.tables[self.control_point] {
bir::ControlPointData::Terminator(TerminatorData::Return(_)) => true,
_ => false,
}
matches!(
&bir_data.tables[self.control_point],
bir::ControlPointData::Terminator(TerminatorData::Return(_)),
)
}

pub fn span(&self, db: &dyn crate::Db) -> FileSpan {
Expand Down

0 comments on commit 3a351d3

Please sign in to comment.