Skip to content

Commit

Permalink
Fix clippy for Rust 1.83 (#1332)
Browse files Browse the repository at this point in the history
* clippy: fix empty_line_after_doc_comment

* clippy: fix empty_line_after_outer_attr

* clippy: autofix needless_return and needless_lifetimes

* reno: add fragment for #1332

* Revert "reno: add fragment for #1332"

This reverts commit 9d1b0c9.

---------

Co-authored-by: Ivan Carvalho <[email protected]>
  • Loading branch information
airwoodix and IvanIsCoding authored Nov 30, 2024
1 parent 37bee6f commit b66662f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion rustworkx-core/src/generators/star_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use super::InvalidInputError;
/// * `bidirectional` - Whether edges are added bidirectionally. If set to
/// `true` then for any edge `(u, v)` an edge `(v, u)` will also be added.
/// If the graph is undirected this will result in a parallel edge.
///
/// # Example
/// ```rust
/// use rustworkx_core::petgraph;
Expand Down
1 change: 0 additions & 1 deletion rustworkx-core/src/token_swapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ where
/// assert_eq!(3, output.len());
///
/// ```
pub fn token_swapper<G>(
graph: G,
mapping: HashMap<G::NodeId, G::NodeId>,
Expand Down
6 changes: 3 additions & 3 deletions src/dag_algo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ pub fn collect_runs(
// This is where a filter function error will be returned, otherwise Result is stripped away
let py_run: Vec<PyObject> = run_result?
.iter()
.map(|node| return graph.graph.node_weight(*node).into_py(py))
.map(|node| graph.graph.node_weight(*node).into_py(py))
.collect();

result.push(py_run)
Expand Down Expand Up @@ -667,7 +667,7 @@ pub fn transitive_reduction(
);
}
}
return Ok((
Ok((
digraph::PyDiGraph {
graph: tr,
node_removed: false,
Expand All @@ -680,5 +680,5 @@ pub fn transitive_reduction(
.iter()
.map(|(k, v)| (k.index(), v.index()))
.collect::<DictMap<usize, usize>>(),
));
))
}
4 changes: 2 additions & 2 deletions src/digraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl GraphBase for PyDiGraph {
type EdgeId = EdgeIndex;
}

impl<'a> NodesRemoved for &'a PyDiGraph {
impl NodesRemoved for &PyDiGraph {
fn nodes_removed(&self) -> bool {
self.node_removed
}
Expand Down Expand Up @@ -886,7 +886,7 @@ impl PyDiGraph {
///
/// :param int node_a: The index for the first node
/// :param int node_b: The index for the second node
///
/// :returns: A list with all the data objects for the edges between nodes
/// :rtype: list
/// :raises NoEdgeBetweenNodes: When there is no edge between nodes
Expand Down
2 changes: 1 addition & 1 deletion src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl GraphBase for PyGraph {
type EdgeId = EdgeIndex;
}

impl<'a> NodesRemoved for &'a PyGraph {
impl NodesRemoved for &PyGraph {
fn nodes_removed(&self) -> bool {
self.node_removed
}
Expand Down
12 changes: 6 additions & 6 deletions src/iterators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ where
}
}

impl<'py, T> PyEq<Bound<'py, PyAny>> for T
impl<T> PyEq<Bound<'_, PyAny>> for T
where
for<'p> T: PyEq<T> + Clone + FromPyObject<'p>,
{
Expand Down Expand Up @@ -1031,7 +1031,7 @@ impl PyHash for EdgeList {
}
}

impl<'py> PyEq<Bound<'py, PyAny>> for EdgeList {
impl PyEq<Bound<'_, PyAny>> for EdgeList {
#[inline]
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
PyEq::eq(&self.edges, other, py)
Expand Down Expand Up @@ -1119,7 +1119,7 @@ impl PyHash for IndexPartitionBlock {
}
}

impl<'py> PyEq<Bound<'py, PyAny>> for IndexPartitionBlock {
impl PyEq<Bound<'_, PyAny>> for IndexPartitionBlock {
#[inline]
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
PyEq::eq(&self.block, other, py)
Expand Down Expand Up @@ -1522,7 +1522,7 @@ impl PyHash for PathMapping {
}
}

impl<'py> PyEq<Bound<'py, PyAny>> for PathMapping {
impl PyEq<Bound<'_, PyAny>> for PathMapping {
#[inline]
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
PyEq::eq(&self.paths, other, py)
Expand Down Expand Up @@ -1686,7 +1686,7 @@ impl PyHash for MultiplePathMapping {
}
}

impl<'py> PyEq<Bound<'py, PyAny>> for MultiplePathMapping {
impl PyEq<Bound<'_, PyAny>> for MultiplePathMapping {
#[inline]
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
PyEq::eq(&self.paths, other, py)
Expand Down Expand Up @@ -1750,7 +1750,7 @@ impl PyHash for PathLengthMapping {
}
}

impl<'py> PyEq<Bound<'py, PyAny>> for PathLengthMapping {
impl PyEq<Bound<'_, PyAny>> for PathLengthMapping {
#[inline]
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
PyEq::eq(&self.path_lengths, other, py)
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub trait NodesRemoved {
fn nodes_removed(&self) -> bool;
}

impl<'a, Ty> NodesRemoved for &'a StablePyGraph<Ty>
impl<Ty> NodesRemoved for &StablePyGraph<Ty>
where
Ty: EdgeType,
{
Expand Down

0 comments on commit b66662f

Please sign in to comment.