Skip to content

Commit

Permalink
Relaxed QueryStream's lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
gammelalf committed Sep 8, 2024
1 parent 1a4f7e8 commit bd941e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/crud/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ mod query_stream {
decoder: D,
ctx: QueryContext<'cond>,
stream_builder: impl FnOnce(
&'this QueryContext,
&'this QueryContext<'cond>,
) -> <Stream as QueryStrategyResult>::Result<'this>,
) -> Self {
unsafe fn change_lifetime<'old, 'new: 'old, T: 'new + ?Sized>(
Expand All @@ -449,7 +449,7 @@ mod query_stream {

unsafe {
let ctx = Box::new(ctx);
let ctx_ref: &'this QueryContext = change_lifetime(ctx.as_ref());
let ctx_ref: &'this QueryContext<'cond> = change_lifetime(ctx.as_ref());

let stream = stream_builder(ctx_ref);

Expand All @@ -462,7 +462,7 @@ mod query_stream {
}
}

impl<'this, 'cond: 'this, D: Decoder> futures::stream::Stream for QueryStream<'this, 'cond, D> {
impl<'this, 'cond, D: Decoder> futures::stream::Stream for QueryStream<'this, 'cond, D> {
type Item = Result<D::Result, Error>;

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Expand Down

0 comments on commit bd941e9

Please sign in to comment.