Skip to content

Commit ae8ac16

Browse files
committed
Fix clippy
1 parent b80e529 commit ae8ac16

File tree

4 files changed

+21
-27
lines changed

4 files changed

+21
-27
lines changed

src/rope/gap_buffer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1446,8 +1446,8 @@ impl<'a, const CHUNKS: usize, const MAX_BYTES: usize>
14461446
}
14471447
}
14481448

1449-
impl<'a, const CHUNKS: usize, const MAX_BYTES: usize> Iterator
1450-
for Resegmenter<'a, CHUNKS, MAX_BYTES>
1449+
impl<const CHUNKS: usize, const MAX_BYTES: usize> Iterator
1450+
for Resegmenter<'_, CHUNKS, MAX_BYTES>
14511451
{
14521452
type Item = GapBuffer<MAX_BYTES>;
14531453

src/rope/iterators.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl<'a> From<&RopeSlice<'a>> for Chars<'a> {
277277
}
278278
}
279279

280-
impl<'a> Iterator for Chars<'a> {
280+
impl Iterator for Chars<'_> {
281281
type Item = char;
282282

283283
#[inline]

src/tree/leaves.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ use alloc::vec::Vec;
33
use super::{Arc, Inode, Leaf, Metric, Node, Tree, TreeSlice};
44

55
/// An iterator over the leaves of `Tree`s and `TreeSlice`s.
6+
//
7+
// This iterator is implemented using two independent iterators advancing in
8+
// opposite directions.
69
pub struct Leaves<'a, const ARITY: usize, L: Leaf> {
7-
/*
8-
This iterator is implemented using two independent iterators advancing in
9-
opposite directions.
10-
*/
11-
#[rustfmt::skip]
12-
1310
/// Iterates over the leaves from front to back.
1411
forward: LeavesForward<'a, ARITY, L>,
1512

@@ -395,7 +392,7 @@ struct LeavesBackward<'a, const N: usize, L: Leaf> {
395392
whole_total: usize,
396393
}
397394

398-
impl<'a, const N: usize, L: Leaf> Clone for LeavesBackward<'a, N, L> {
395+
impl<const N: usize, L: Leaf> Clone for LeavesBackward<'_, N, L> {
399396
#[inline]
400397
fn clone(&self) -> Self {
401398
Self { path: self.path.clone(), ..*self }

src/tree/units.rs

+14-17
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,22 @@ use super::tree_slice;
55
use super::{Arc, Lnode, Node, Tree, TreeSlice};
66

77
/// An iterator over the units of a metric.
8+
//
9+
// Just like the `Leaves` iterator, this iterator is also implemented using two
10+
// separate iterators, one for iterating forward (used in the `Iterator` impl),
11+
// and the other for iterating backward (used in the `DoubleEndedIterator`
12+
// impl).
13+
//
14+
// These two iterators are completely independent and don't know about each
15+
// other, which could cause them to overlap if alternating between calling
16+
// `Units::next()` and `Units::next_back()`.
17+
//
18+
// To prevent this we also store the base measure of the unyielded iterating
19+
// range, which is decreased as new `TreeSliece`s are yielded (both forward and
20+
// backward). Once that reaches zero this iterator will stop yielding any more
21+
// items.
822
#[derive(Clone)]
923
pub struct Units<'a, const ARITY: usize, L: Leaf, M: Metric<L::Summary>> {
10-
/*
11-
Just like the `Leaves` iterator, this iterator is also implemented using
12-
two separate iterators, one for iterating forward (used in the `Iterator`
13-
impl), and the other for iterating backward (used in the
14-
`DoubleEndedIterator` impl).
15-
16-
These two iterators are completely independent and don't know about each
17-
other, which could cause them to overlap if alternating between calling
18-
`Units::next()` and `Units::next_back()`.
19-
20-
To prevent this we also store the base measure of the unyielded iterating
21-
range, which is decreased as new `TreeSliece`s are yielded (both forward
22-
and backward). Once that reaches zero this iterator will stop yielding
23-
any more items.
24-
*/
25-
#[rustfmt::skip]
26-
2724
/// Iterates over the `M`-units from front to back.
2825
forward: UnitsForward<'a, ARITY, L, M>,
2926

0 commit comments

Comments
 (0)