Skip to content

Commit

Permalink
Remove multiline uses
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Nov 21, 2020
1 parent e0e906b commit 4612658
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 115 deletions.
7 changes: 2 additions & 5 deletions library/core/src/iter/adapters/chain.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use crate::{
iter::{DoubleEndedIterator, FusedIterator, Iterator, TrustedLen},
ops::Try,
usize,
};
use crate::iter::{DoubleEndedIterator, FusedIterator, Iterator, TrustedLen};
use crate::{ops::Try, usize};

/// An iterator that links two iterators together, in a chain.
///
Expand Down
9 changes: 3 additions & 6 deletions library/core/src/iter/adapters/cloned.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::{
iter::{
adapters::zip::try_get_unchecked, adapters::TrustedRandomAccess, FusedIterator, TrustedLen,
},
ops::Try,
};
use crate::iter::adapters::{zip::try_get_unchecked, TrustedRandomAccess};
use crate::iter::{FusedIterator, TrustedLen};
use crate::ops::Try;

/// An iterator that clones the elements of an underlying iterator.
///
Expand Down
9 changes: 3 additions & 6 deletions library/core/src/iter/adapters/copied.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::{
iter::{
adapters::zip::try_get_unchecked, adapters::TrustedRandomAccess, FusedIterator, TrustedLen,
},
ops::Try,
};
use crate::iter::adapters::{zip::try_get_unchecked, TrustedRandomAccess};
use crate::iter::{FusedIterator, TrustedLen};
use crate::ops::Try;

/// An iterator that copies the elements of an underlying iterator.
///
Expand Down
10 changes: 3 additions & 7 deletions library/core/src/iter/adapters/enumerate.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use crate::{
iter::{
adapters::{zip::try_get_unchecked, SourceIter, TrustedRandomAccess},
FusedIterator, InPlaceIterable, TrustedLen,
},
ops::{Add, AddAssign, Try},
};
use crate::iter::adapters::{zip::try_get_unchecked, SourceIter, TrustedRandomAccess};
use crate::iter::{FusedIterator, InPlaceIterable, TrustedLen};
use crate::ops::{Add, AddAssign, Try};

/// An iterator that yields the current count and the element during iteration.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/filter.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable},
ops::Try,
};
use crate::fmt;
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable};
use crate::ops::Try;

/// An iterator that filters the elements of `iter` with `predicate`.
///
Expand Down
9 changes: 3 additions & 6 deletions library/core/src/iter/adapters/filter_map.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::{
fmt,
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable},
ops::ControlFlow,
ops::Try,
};
use crate::fmt;
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable};
use crate::ops::{ControlFlow, Try};

/// An iterator that uses `f` to both filter and map elements from `iter`.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/flatten.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{DoubleEndedIterator, Fuse, FusedIterator, Iterator, Map},
ops::Try,
};
use crate::fmt;
use crate::iter::{DoubleEndedIterator, Fuse, FusedIterator, Iterator, Map};
use crate::ops::Try;

/// An iterator that maps each element to an iterator, and yields the elements
/// of the produced iterators.
Expand Down
12 changes: 4 additions & 8 deletions library/core/src/iter/adapters/fuse.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use crate::{
intrinsics,
iter::{
adapters::{zip::try_get_unchecked, InPlaceIterable, SourceIter},
DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator, TrustedRandomAccess,
},
ops::Try,
};
use crate::intrinsics;
use crate::iter::adapters::{zip::try_get_unchecked, InPlaceIterable, SourceIter};
use crate::iter::{DoubleEndedIterator, ExactSizeIterator, FusedIterator, TrustedRandomAccess};
use crate::ops::Try;

/// An iterator that yields `None` forever after the underlying iterator
/// yields `None` once.
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/inspect.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable},
ops::Try,
};
use crate::fmt;
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable};
use crate::ops::Try;

/// An iterator that calls a function with a reference to each element before
/// yielding it.
Expand Down
12 changes: 4 additions & 8 deletions library/core/src/iter/adapters/map.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use crate::{
fmt,
iter::{
adapters::{zip::try_get_unchecked, SourceIter, TrustedRandomAccess},
FusedIterator, InPlaceIterable, TrustedLen,
},
ops::Try,
};
use crate::fmt;
use crate::iter::adapters::{zip::try_get_unchecked, SourceIter, TrustedRandomAccess};
use crate::iter::{FusedIterator, InPlaceIterable, TrustedLen};
use crate::ops::Try;

/// An iterator that maps the values of `iter` with `f`.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/map_while.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{adapters::SourceIter, InPlaceIterable},
ops::{ControlFlow, Try},
};
use crate::fmt;
use crate::iter::{adapters::SourceIter, InPlaceIterable};
use crate::ops::{ControlFlow, Try};

/// An iterator that only accepts elements while `predicate` returns `Some(_)`.
///
Expand Down
6 changes: 2 additions & 4 deletions library/core/src/iter/adapters/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
iter::{InPlaceIterable, Iterator},
ops::{ControlFlow, Try},
};
use crate::iter::{InPlaceIterable, Iterator};
use crate::ops::{ControlFlow, Try};

mod chain;
mod cloned;
Expand Down
6 changes: 2 additions & 4 deletions library/core/src/iter/adapters/peekable.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedLen},
ops::Try,
};
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedLen};
use crate::ops::Try;

/// An iterator with a `peek()` that returns an optional reference to the next
/// element.
Expand Down
6 changes: 2 additions & 4 deletions library/core/src/iter/adapters/rev.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
iter::{FusedIterator, TrustedLen},
ops::Try,
};
use crate::iter::{FusedIterator, TrustedLen};
use crate::ops::Try;

/// A double-ended iterator with the direction inverted.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/scan.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{adapters::SourceIter, InPlaceIterable},
ops::{ControlFlow, Try},
};
use crate::fmt;
use crate::iter::{adapters::SourceIter, InPlaceIterable};
use crate::ops::{ControlFlow, Try};

/// An iterator to maintain state while iterating another iterator.
///
Expand Down
6 changes: 2 additions & 4 deletions library/core/src/iter/adapters/skip.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable},
ops::{ControlFlow, Try},
};
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable};
use crate::ops::{ControlFlow, Try};

/// An iterator that skips over `n` elements of `iter`.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/skip_while.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable},
ops::Try,
};
use crate::fmt;
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable};
use crate::ops::Try;

/// An iterator that rejects elements while `predicate` returns `true`.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/take.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
cmp,
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedLen},
ops::{ControlFlow, Try},
};
use crate::cmp;
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedLen};
use crate::ops::{ControlFlow, Try};

/// An iterator that only iterates over the first `n` iterations of `iter`.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/adapters/take_while.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{adapters::SourceIter, FusedIterator, InPlaceIterable},
ops::{ControlFlow, Try},
};
use crate::fmt;
use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable};
use crate::ops::{ControlFlow, Try};

/// An iterator that only accepts elements while `predicate` returns `true`.
///
Expand Down
12 changes: 4 additions & 8 deletions library/core/src/iter/adapters/zip.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use crate::{
cmp,
fmt::{self, Debug},
iter::{
DoubleEndedIterator, ExactSizeIterator, FusedIterator, InPlaceIterable, Iterator,
SourceIter, TrustedLen,
},
};
use crate::cmp;
use crate::fmt::{self, Debug};
use crate::iter::{DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator};
use crate::iter::{InPlaceIterable, SourceIter, TrustedLen};

/// An iterator that iterates two other iterators simultaneously.
///
Expand Down
8 changes: 3 additions & 5 deletions library/core/src/iter/sources/empty.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
fmt,
iter::{FusedIterator, TrustedLen},
marker,
};
use crate::fmt;
use crate::iter::{FusedIterator, TrustedLen};
use crate::marker;

/// Creates an iterator that yields nothing.
///
Expand Down

0 comments on commit 4612658

Please sign in to comment.