Skip to content

Commit

Permalink
implement FusedIterator for Response and Responses
Browse files Browse the repository at this point in the history
  • Loading branch information
benmaddison committed May 14, 2023
1 parent 5fd2110 commit c1f92d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/pipeline.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::collections::VecDeque;
use std::convert::TryFrom;
use std::fmt;
use std::iter::FusedIterator;
use std::marker::PhantomData;
use std::str::{from_utf8, FromStr};

Expand Down Expand Up @@ -396,6 +397,13 @@ where
}
}

impl<T> FusedIterator for Responses<'_, '_, T>
where
T: FromStr + fmt::Debug,
T::Err: std::error::Error + Send + Sync + 'static,
{
}

/// A successful query response.
///
/// If the query returned data, this can be accessed by iteration over
Expand Down Expand Up @@ -543,6 +551,13 @@ where
}
}

impl<T> FusedIterator for Response<'_, '_, T>
where
T: FromStr + fmt::Debug,
T::Err: std::error::Error + Send + Sync + 'static,
{
}

enum ItemOrYield<'a, 'b, T>
where
T: FromStr + fmt::Debug,
Expand Down

0 comments on commit c1f92d8

Please sign in to comment.