Skip to content

Commit

Permalink
Avoid 2024 edition keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 13, 2025
1 parent 9affc6a commit 4cd965c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions futures-async-stream-macro/src/elision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ impl VisitMut for UnelideLifetimes<'_> {
visit_mut::visit_type_reference_mut(self, ty);
}

fn visit_generic_argument_mut(&mut self, gen: &mut GenericArgument) {
if let GenericArgument::Lifetime(lifetime) = gen {
fn visit_generic_argument_mut(&mut self, arg: &mut GenericArgument) {
if let GenericArgument::Lifetime(lifetime) = arg {
self.visit_lifetime(lifetime);
}
visit_mut::visit_generic_argument_mut(self, gen);
visit_mut::visit_generic_argument_mut(self, arg);
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ mod future {
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
#[doc(hidden)]
#[inline]
pub fn from_coroutine<G>(gen: G) -> impl Future<Output = G::Return>
pub fn from_coroutine<G>(g: G) -> impl Future<Output = G::Return>
where
G: Coroutine<ResumeTy, Yield = ()>,
{
GenFuture(gen)
GenFuture(g)
}

#[pin_project]
Expand Down Expand Up @@ -398,11 +398,11 @@ mod stream {
/// better error messages (`impl Stream` rather than `GenStream<[closure.....]>`).
#[doc(hidden)]
#[inline]
pub fn from_coroutine<G, T>(gen: G) -> impl Stream<Item = T>
pub fn from_coroutine<G, T>(g: G) -> impl Stream<Item = T>
where
G: Coroutine<ResumeTy, Yield = Poll<T>, Return = ()>,
{
GenStream(gen)
GenStream(g)
}

#[pin_project]
Expand Down Expand Up @@ -469,11 +469,11 @@ mod try_stream {
/// better error messages (`impl Stream` rather than `GenStream<[closure.....]>`).
#[doc(hidden)]
#[inline]
pub fn from_coroutine<G, T, E>(gen: G) -> impl FusedStream<Item = Result<T, E>>
pub fn from_coroutine<G, T, E>(g: G) -> impl FusedStream<Item = Result<T, E>>
where
G: Coroutine<ResumeTy, Yield = Poll<T>, Return = Result<(), E>>,
{
GenTryStream(Some(gen))
GenTryStream(Some(g))
}

#[pin_project]
Expand All @@ -488,8 +488,8 @@ mod try_stream {
#[inline]
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let mut this = self.project();
if let Some(gen) = this.0.as_mut().as_pin_mut() {
let res = match gen.resume(ResumeTy(NonNull::from(cx).cast::<Context<'static>>())) {
if let Some(g) = this.0.as_mut().as_pin_mut() {
let res = match g.resume(ResumeTy(NonNull::from(cx).cast::<Context<'static>>())) {
CoroutineState::Yielded(x) => x.map(|x| Some(Ok(x))),
CoroutineState::Complete(Err(e)) => Poll::Ready(Some(Err(e))),
CoroutineState::Complete(Ok(())) => Poll::Ready(None),
Expand Down

0 comments on commit 4cd965c

Please sign in to comment.