Skip to content

Commit

Permalink
style: clippy cleanups for latest stable rust
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed Jan 10, 2025
1 parent b968f5b commit db50a9b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
25 changes: 12 additions & 13 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion dfir_lang/src/graph/eliminate_extra_unions_tees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn find_unary_ops<'a>(
.filter(move |&node_id| {
graph
.node_op_inst(node_id)
.map_or(false, |op_inst| op_name == op_inst.op_constraints.name)
.is_some_and(|op_inst| op_name == op_inst.op_constraints.name)
})
.filter(|&node_id| {
1 == graph.node_degree_in(node_id) && 1 == graph.node_degree_out(node_id)
Expand Down
2 changes: 1 addition & 1 deletion dfir_lang/src/graph/hydroflow_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ impl DfirGraph {
.iter()
.position(|&node_id| {
self.node_color(node_id)
.map_or(false, |color| Color::Pull != color)
.is_some_and(|color| Color::Pull != color)
})
.unwrap_or(subgraph_nodes.len())
}
Expand Down
6 changes: 3 additions & 3 deletions dfir_rs/src/util/unsync/mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl<T> Sender<T> {
let mut shared = strong.borrow_mut();
if shared
.capacity
.map_or(false, |cap| cap.get() <= shared.buffer.len())
.is_some_and(|cap| cap.get() <= shared.buffer.len())
{
// Full.
shared.send_wakers.push(ctx.waker().clone());
Expand Down Expand Up @@ -53,7 +53,7 @@ impl<T> Sender<T> {
let mut shared = strong.borrow_mut();
if shared
.capacity
.map_or(false, |cap| cap.get() <= shared.buffer.len())
.is_some_and(|cap| cap.get() <= shared.buffer.len())
{
Err(TrySendError::Full(item))
} else {
Expand Down Expand Up @@ -104,7 +104,7 @@ impl<T> Sink<T> for Sender<T> {
let mut shared = strong.borrow_mut();
if shared
.capacity
.map_or(false, |cap| cap.get() <= shared.buffer.len())
.is_some_and(|cap| cap.get() <= shared.buffer.len())
{
// Full.
shared.send_wakers.push(ctx.waker().clone());
Expand Down
2 changes: 1 addition & 1 deletion lattices/src/with_bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ where
Inner: IsTop,
{
fn is_top(&self) -> bool {
self.0.as_ref().map_or(false, IsTop::is_top)
self.0.as_ref().is_some_and(IsTop::is_top)
}
}

Expand Down
2 changes: 1 addition & 1 deletion lattices/src/with_top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ where
Inner: IsBot,
{
fn is_bot(&self) -> bool {
self.0.as_ref().map_or(false, IsBot::is_bot)
self.0.as_ref().is_some_and(IsBot::is_bot)
}
}

Expand Down

0 comments on commit db50a9b

Please sign in to comment.