Skip to content

Commit 469896c

Browse files
committed
fix clippy
1 parent 468818b commit 469896c

File tree

6 files changed

+35
-31
lines changed

6 files changed

+35
-31
lines changed

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ criterion = "0.5"
3838
rand = "0.8"
3939
ropey = "1.6"
4040

41+
[lints.rust]
42+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
43+
4144
[[bench]]
4245
name = "creation"
4346
harness = false

src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@
131131
//! - `simd` (enabled by default): enables SIMD on supported platforms;
132132
//!
133133
//! - `graphemes` (disabled by default): enables a few grapheme-oriented APIs
134-
//! on `Rope`s and `RopeSlice`s such as the
135-
//! [`Graphemes`](crate::iter::Graphemes) iterator and others;
134+
//! on `Rope`s and `RopeSlice`s such as the
135+
//! [`Graphemes`](crate::iter::Graphemes) iterator and others;
136136
//!
137137
//! - `utf16-metric` (disabled by default): makes the `Rope` and `RopeSlice`
138-
//! track the UTF-16 code units they'd have if their content was stored as
139-
//! UTF-16 instead of UTF-8, allowing them to efficiently convert UTF-16
140-
//! code unit offsets to and from byte offsets in logarithmic time.
138+
//! track the UTF-16 code units they'd have if their content was stored as
139+
//! UTF-16 instead of UTF-8, allowing them to efficiently convert UTF-16
140+
//! code unit offsets to and from byte offsets in logarithmic time.
141141
142142
#![allow(clippy::explicit_auto_deref)]
143143
#![allow(clippy::module_inception)]

src/tree/node_internal.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ impl<const N: usize, L: Leaf> Inode<N, L> {
275275
/// - this inode has only one child (the second child is assumed to exist);
276276
///
277277
/// - the `Arc` enclosing the first child has a strong counter > 1. This
278-
/// function assumes that there are zero `Arc::clone`s of the first child.
278+
/// function assumes that there are zero `Arc::clone`s of the first
279+
/// child.
279280
#[inline]
280281
pub(super) fn balance_first_child_with_second(&mut self)
281282
where
@@ -340,10 +341,10 @@ impl<const N: usize, L: Leaf> Inode<N, L> {
340341
/// Panics if:
341342
///
342343
/// - this inode has only one child (the penultimate child is assumed to
343-
/// exist);
344+
/// exist);
344345
///
345346
/// - the `Arc` enclosing the last child has a strong counter > 1. This
346-
/// function assumes that there are zero `Arc::clone`s of the last child.
347+
/// function assumes that there are zero `Arc::clone`s of the last child.
347348
#[inline]
348349
pub(super) fn balance_last_child_with_penultimate(&mut self)
349350
where

src/tree/tree.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ mod from_treeslice {
283283
/// Returns a `(root, invalid_first, invalid_last)` tuple where:
284284
///
285285
/// - `root` is the internal node obtained by removing all the nodes before
286-
/// `slice.before` and after `slice.before + slice.base_measure`,
286+
/// `slice.before` and after `slice.before + slice.base_measure`,
287287
///
288288
/// - `invalid_{first,last}` are the number of invalid nodes contained in
289-
/// the subtrees of the first and last child, respectively.
289+
/// the subtrees of the first and last child, respectively.
290290
///
291291
/// Note that all the `Arc`s enclosing the nodes on the left and right side
292292
/// of the subtree under `root` are guaranteed to have a strong count of 1,

src/tree/tree_builder.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ pub struct TreeBuilder<const ARITY: usize, L: Leaf> {
1313
/// - all the inodes within a stack level have the same depth;
1414
///
1515
/// - all the vectors at every stack level have a length strictly less than
16-
/// `ARITY` (but it could also be zero, i.e. all levels except the first
17-
/// one can be empty);
16+
/// `ARITY` (but it could also be zero, i.e. all levels except the first
17+
/// one can be empty);
1818
///
1919
/// - the inodes are grouped in order of descending depth, with each stack
20-
/// level containing inodes of depth one less than the previous level;
20+
/// level containing inodes of depth one less than the previous level;
2121
///
2222
/// - every inode at every stack level is completely full, i.e. for every
23-
/// inode it holds `inode.leaf_count() == max_children ^ inode.depth()`;
23+
/// inode it holds `inode.leaf_count() == max_children ^ inode.depth()`;
2424
///
2525
/// - all the inodes in the last stack level (assuming there are any) have
26-
/// a depth of 1.
26+
/// a depth of 1.
2727
stack: Vec<Vec<Arc<Node<ARITY, L>>>>,
2828

2929
/// A bunch of leaves waiting to be grouped into an internal node.

src/tree/units.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -464,17 +464,17 @@ impl<'a, const N: usize, L: Leaf, M: UnitMetric<L>> UnitsForward<'a, N, L, M> {
464464
/// - `leaf` is that leaf node;
465465
///
466466
/// - `root` is the deepest internal node containing both the current
467-
/// `self.leaf_node` and `leaf` in its subtree;
467+
/// `self.leaf_node` and `leaf` in its subtree;
468468
///
469469
/// - `before` is the total base measure of all the nodes from the first
470-
/// leaf in `root`'s subtree to the leaf preceding the current
471-
/// `self.leaf_node`. If `self.leaf_node` is the first leaf in `root`'s
472-
/// subtree this measure will be zero;
470+
/// leaf in `root`'s subtree to the leaf preceding the current
471+
/// `self.leaf_node`. If `self.leaf_node` is the first leaf in `root`'s
472+
/// subtree this measure will be zero;
473473
///
474474
/// - `summary` and `count` are the total summary and leaf count of all the
475-
/// nodes between (but not including) `self.leaf_node` and `leaf`. If
476-
/// `leaf` is the leaf node immediately after `self.leaf` then `summary`
477-
/// will be empty and `count` will be zero.
475+
/// nodes between (but not including) `self.leaf_node` and `leaf`. If
476+
/// `leaf` is the leaf node immediately after `self.leaf` then `summary`
477+
/// will be empty and `count` will be zero.
478478
///
479479
/// NOTE: it assumes that such a leaf node exists. If that's not the case
480480
/// this function may panic or return a leaf node outside of the valid
@@ -1280,8 +1280,8 @@ impl<'a, const N: usize, L: Leaf, M: DoubleEndedUnitMetric<L>>
12801280

12811281
/// Yields the first unit in the range. This function is used by
12821282
///
1283-
/// - [`Self::remainder()`] if there are no units in the iterating range, in
1284-
/// which case it'll yield the whole range;
1283+
/// - [`Self::remainder()`] if there are no units in the iterating range,
1284+
/// in which case it'll yield the whole range;
12851285
///
12861286
/// - by [`Self::previous()`] when there's one final unit to yield.
12871287
#[inline]
@@ -1424,17 +1424,17 @@ impl<'a, const N: usize, L: Leaf, M: DoubleEndedUnitMetric<L>>
14241424
/// - `leaf` is that leaf node;
14251425
///
14261426
/// - `root` is the deepest internal node containing both `leaf` and the
1427-
/// current `self.leaf_node` in its subtree;
1427+
/// current `self.leaf_node` in its subtree;
14281428
///
14291429
/// - `after` is the total base measure of all the nodes from the last leaf
1430-
/// in `root`'s subtree to the leaf after the current `self.leaf_node`. If
1431-
/// `self.leaf_node` if the last leaf in `root`'s subtree this measure will
1432-
/// be zero;
1430+
/// in `root`'s subtree to the leaf after the current `self.leaf_node`.
1431+
/// If `self.leaf_node` if the last leaf in `root`'s subtree this measure
1432+
/// will be zero;
14331433
///
14341434
/// - `summary` and `count` are the total summary and leaf count of all the
1435-
/// nodes between (but not including) `leaf` and `self.leaf_node`. If
1436-
/// `leaf` is the leaf node immediately before `self.leaf` then `summary`
1437-
/// will be empty and `count` will be zero.
1435+
/// nodes between (but not including) `leaf` and `self.leaf_node`. If
1436+
/// `leaf` is the leaf node immediately before `self.leaf` then `summary`
1437+
/// will be empty and `count` will be zero.
14381438
///
14391439
/// NOTE: it assumes that such a leaf node exists. If that's not the case
14401440
/// this function may panic or return a leaf node outside of the valid

0 commit comments

Comments
 (0)