Skip to content

Commit cd5baab

Browse files
committed
Follow structure of other util structs
1 parent 86104c2 commit cd5baab

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/run_query_dsl/utils.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,27 @@ where
8383
///
8484
/// Consumes the entire stream to ensure proper cleanup before returning which is
8585
/// required to fix: https://github.com/weiznich/diesel_async/issues/269
86-
pub struct LoadNext<St>
87-
where
88-
St: TryStream<Error = diesel::result::Error> + Unpin,
89-
{
90-
future: futures_util::stream::TryCollect<St, Vec<St::Ok>>,
86+
#[repr(transparent)]
87+
pub struct LoadNext<T: TryStreamExt> {
88+
future: futures_util::stream::TryCollect<T, Vec<T::Ok>>,
9189
}
9290

93-
impl<St> LoadNext<St>
91+
impl<T> LoadNext<T>
9492
where
95-
St: TryStream<Error = diesel::result::Error> + Unpin,
93+
T: TryStream<Error = diesel::result::Error> + Unpin,
9694
{
97-
pub(crate) fn new(stream: St) -> Self {
95+
pub(crate) fn new(stream: T) -> Self {
9896
Self {
9997
future: stream.try_collect(),
10098
}
10199
}
102100
}
103101

104-
impl<St> Future for LoadNext<St>
102+
impl<T> Future for LoadNext<T>
105103
where
106-
St: TryStream<Error = diesel::result::Error> + Unpin,
104+
T: TryStream<Error = diesel::result::Error> + Unpin,
107105
{
108-
type Output = QueryResult<St::Ok>;
106+
type Output = QueryResult<T::Ok>;
109107

110108
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
111109
match Pin::new(&mut self.future).poll(cx) {

0 commit comments

Comments
 (0)