Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix new lints in Rust 1.84 #170

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/multiportgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl PortView for MultiPortGraph {
fn contains_port(&self, port: PortIndex) -> bool {
self.graph
.port_node(port)
.map_or(false, |node| !self.copy_node.get(node))
.is_some_and(|node| !self.copy_node.get(node))
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/secondary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ where
fn get(&self, key: K) -> &bool {
// We can't return a reference to the internal bitflags, so we have to
// create static bools.
if BitSlice::get(self, key.into()).map_or(false, |f| *f) {
if BitSlice::get(self, key.into()).is_some_and(|f| *f) {
&true
} else {
&false
Expand Down
6 changes: 3 additions & 3 deletions src/view/flat_region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ where
}
}

impl<'g, G> PortView for FlatRegion<'g, G>
impl<G> PortView for FlatRegion<'_, G>
where
G: PortView + Clone,
{
Expand Down Expand Up @@ -127,7 +127,7 @@ where
}
}

impl<'g, G> LinkView for FlatRegion<'g, G>
impl<G> LinkView for FlatRegion<'_, G>
where
G: LinkView + Clone,
{
Expand Down Expand Up @@ -196,7 +196,7 @@ where
}
}

impl<'g, G> MultiView for FlatRegion<'g, G>
impl<G> MultiView for FlatRegion<'_, G>
where
G: MultiView + Clone,
{
Expand Down
6 changes: 3 additions & 3 deletions src/view/refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use delegate::delegate;

use super::{LinkView, MultiView, PortView};

impl<'g, G: PortView> PortView for &'g G {
impl<G: PortView> PortView for &G {
delegate! {
to (*self) {
fn port_direction(&self, port: impl Into<PortIndex>) -> Option<Direction>;
Expand Down Expand Up @@ -37,7 +37,7 @@ impl<'g, G: PortView> PortView for &'g G {
}
}

impl<'g, G: LinkView> LinkView for &'g G {
impl<G: LinkView> LinkView for &G {
type LinkEndpoint = G::LinkEndpoint;

delegate! {
Expand All @@ -53,7 +53,7 @@ impl<'g, G: LinkView> LinkView for &'g G {
}
}

impl<'g, G: MultiView> MultiView for &'g G {
impl<G: MultiView> MultiView for &G {
delegate! {
to (*self) {
fn subports(&self, node: NodeIndex, direction: Direction) -> impl Iterator<Item = Self::LinkEndpoint> + Clone;
Expand Down
8 changes: 4 additions & 4 deletions src/view/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ where
let first_visited_ancestor = self.hierarchy.parent(*ancestors.last().unwrap());
let is_descendant = first_visited_ancestor == Some(self.region_root)
|| first_visited_ancestor
.map_or(false, |ancestor| cache.get(&ancestor).copied().unwrap());
.is_some_and(|ancestor| cache.get(&ancestor).copied().unwrap());

// The read lock is dropped here, before we reacquire it for writing
// the computed values.
Expand Down Expand Up @@ -142,7 +142,7 @@ impl<G: Clone> Clone for Region<'_, G> {
}
}

impl<'g, G> PortView for Region<'g, G>
impl<G> PortView for Region<'_, G>
where
G: PortView + Clone,
{
Expand Down Expand Up @@ -212,7 +212,7 @@ where
}
}

impl<'g, G> LinkView for Region<'g, G>
impl<G> LinkView for Region<'_, G>
where
G: LinkView + Clone,
{
Expand Down Expand Up @@ -281,7 +281,7 @@ where
}
}

impl<'g, G> MultiView for Region<'g, G>
impl<G> MultiView for Region<'_, G>
where
G: MultiView + Clone,
{
Expand Down
Loading