Skip to content

Commit b66662f

Browse files
Fix clippy for Rust 1.83 (#1332)
* 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]>
1 parent 37bee6f commit b66662f

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

rustworkx-core/src/generators/star_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use super::InvalidInputError;
3434
/// * `bidirectional` - Whether edges are added bidirectionally. If set to
3535
/// `true` then for any edge `(u, v)` an edge `(v, u)` will also be added.
3636
/// If the graph is undirected this will result in a parallel edge.
37-
37+
///
3838
/// # Example
3939
/// ```rust
4040
/// use rustworkx_core::petgraph;

rustworkx-core/src/token_swapper.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ where
437437
/// assert_eq!(3, output.len());
438438
///
439439
/// ```
440-
441440
pub fn token_swapper<G>(
442441
graph: G,
443442
mapping: HashMap<G::NodeId, G::NodeId>,

src/dag_algo/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ pub fn collect_runs(
524524
// This is where a filter function error will be returned, otherwise Result is stripped away
525525
let py_run: Vec<PyObject> = run_result?
526526
.iter()
527-
.map(|node| return graph.graph.node_weight(*node).into_py(py))
527+
.map(|node| graph.graph.node_weight(*node).into_py(py))
528528
.collect();
529529

530530
result.push(py_run)
@@ -667,7 +667,7 @@ pub fn transitive_reduction(
667667
);
668668
}
669669
}
670-
return Ok((
670+
Ok((
671671
digraph::PyDiGraph {
672672
graph: tr,
673673
node_removed: false,
@@ -680,5 +680,5 @@ pub fn transitive_reduction(
680680
.iter()
681681
.map(|(k, v)| (k.index(), v.index()))
682682
.collect::<DictMap<usize, usize>>(),
683-
));
683+
))
684684
}

src/digraph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl GraphBase for PyDiGraph {
200200
type EdgeId = EdgeIndex;
201201
}
202202

203-
impl<'a> NodesRemoved for &'a PyDiGraph {
203+
impl NodesRemoved for &PyDiGraph {
204204
fn nodes_removed(&self) -> bool {
205205
self.node_removed
206206
}
@@ -886,7 +886,7 @@ impl PyDiGraph {
886886
///
887887
/// :param int node_a: The index for the first node
888888
/// :param int node_b: The index for the second node
889-
889+
///
890890
/// :returns: A list with all the data objects for the edges between nodes
891891
/// :rtype: list
892892
/// :raises NoEdgeBetweenNodes: When there is no edge between nodes

src/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl GraphBase for PyGraph {
161161
type EdgeId = EdgeIndex;
162162
}
163163

164-
impl<'a> NodesRemoved for &'a PyGraph {
164+
impl NodesRemoved for &PyGraph {
165165
fn nodes_removed(&self) -> bool {
166166
self.node_removed
167167
}

src/iterators.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ where
282282
}
283283
}
284284

285-
impl<'py, T> PyEq<Bound<'py, PyAny>> for T
285+
impl<T> PyEq<Bound<'_, PyAny>> for T
286286
where
287287
for<'p> T: PyEq<T> + Clone + FromPyObject<'p>,
288288
{
@@ -1031,7 +1031,7 @@ impl PyHash for EdgeList {
10311031
}
10321032
}
10331033

1034-
impl<'py> PyEq<Bound<'py, PyAny>> for EdgeList {
1034+
impl PyEq<Bound<'_, PyAny>> for EdgeList {
10351035
#[inline]
10361036
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
10371037
PyEq::eq(&self.edges, other, py)
@@ -1119,7 +1119,7 @@ impl PyHash for IndexPartitionBlock {
11191119
}
11201120
}
11211121

1122-
impl<'py> PyEq<Bound<'py, PyAny>> for IndexPartitionBlock {
1122+
impl PyEq<Bound<'_, PyAny>> for IndexPartitionBlock {
11231123
#[inline]
11241124
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
11251125
PyEq::eq(&self.block, other, py)
@@ -1522,7 +1522,7 @@ impl PyHash for PathMapping {
15221522
}
15231523
}
15241524

1525-
impl<'py> PyEq<Bound<'py, PyAny>> for PathMapping {
1525+
impl PyEq<Bound<'_, PyAny>> for PathMapping {
15261526
#[inline]
15271527
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
15281528
PyEq::eq(&self.paths, other, py)
@@ -1686,7 +1686,7 @@ impl PyHash for MultiplePathMapping {
16861686
}
16871687
}
16881688

1689-
impl<'py> PyEq<Bound<'py, PyAny>> for MultiplePathMapping {
1689+
impl PyEq<Bound<'_, PyAny>> for MultiplePathMapping {
16901690
#[inline]
16911691
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
16921692
PyEq::eq(&self.paths, other, py)
@@ -1750,7 +1750,7 @@ impl PyHash for PathLengthMapping {
17501750
}
17511751
}
17521752

1753-
impl<'py> PyEq<Bound<'py, PyAny>> for PathLengthMapping {
1753+
impl PyEq<Bound<'_, PyAny>> for PathLengthMapping {
17541754
#[inline]
17551755
fn eq(&self, other: &Bound<PyAny>, py: Python) -> PyResult<bool> {
17561756
PyEq::eq(&self.path_lengths, other, py)

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub trait NodesRemoved {
203203
fn nodes_removed(&self) -> bool;
204204
}
205205

206-
impl<'a, Ty> NodesRemoved for &'a StablePyGraph<Ty>
206+
impl<Ty> NodesRemoved for &StablePyGraph<Ty>
207207
where
208208
Ty: EdgeType,
209209
{

0 commit comments

Comments
 (0)