clippy: Remove extra Iterator bounds. (#2475)

`Iterator` is a supertrait of `ExactSizeIterator`, so specifying `ExactSizeIterator` is enough.
This commit is contained in:
Bruce Mitchener 2023-09-13 20:45:50 +07:00 committed by GitHub
parent d2c29f012e
commit ae9c1f7847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ pub struct ParseError {
}
impl ParseError {
pub fn labels(&self) -> impl Iterator<Item = (Span, &str)> + ExactSizeIterator + '_ {
pub fn labels(&self) -> impl ExactSizeIterator<Item = (Span, &str)> + '_ {
self.labels
.iter()
.map(|&(span, ref msg)| (span, msg.as_ref()))

View File

@ -181,7 +181,7 @@ impl<E> WithSpan<E> {
}
/// Iterator over stored [`SpanContext`]s.
pub fn spans(&self) -> impl Iterator<Item = &SpanContext> + ExactSizeIterator {
pub fn spans(&self) -> impl ExactSizeIterator<Item = &SpanContext> {
#[cfg(feature = "span")]
return self.spans.iter();
#[cfg(not(feature = "span"))]