Skip to content

Commit

Permalink
fmt & clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Apr 2, 2020
1 parent 9596e40 commit b613044
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/ext/slice_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ pub trait Slice {
A: Array<Item = Self::Item>,
A::Item: Clone;

/// Returns an iterator over all contiguous windows of type `A` (length `A::SIZE`).
/// The windows overlap. If the slice is shorter than size (`A::SIZE`), the iterator returns
/// `None`.
/// Returns an iterator over all contiguous windows of type `A` (length
/// `A::SIZE`). The windows overlap. If the slice is shorter than size
/// (`A::SIZE`), the iterator returns `None`.
///
/// ## Panics
///
Expand All @@ -87,8 +87,8 @@ pub trait Slice {
/// assert_eq!(iter.next(), None);
/// ```
///
/// In difference with [`<[T]>::windows`], this method returns iterator that returns _arrays_,
/// so you can use array destruction:
/// In difference with [`<[T]>::windows`], this method returns iterator that
/// returns _arrays_, so you can use array destruction:
///
/// [`<[T]>::windows`]: https://doc.rust-lang.org/std/primitive.slice.html#method.windows
///
Expand Down
2 changes: 1 addition & 1 deletion src/iter/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ where
{
#[inline]
fn len(&self) -> usize {
(self.slice.len() + 1).checked_sub(A::SIZE).unwrap_or(0)
(self.slice.len() + 1).saturating_sub(A::SIZE)
}

#[inline]
Expand Down

0 comments on commit b613044

Please sign in to comment.