Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing generics on impl for EnumTryAs #337

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

hasali19
Copy link
Contributor

@hasali19 hasali19 commented Mar 5, 2024

The EnumTryAs impl currently does not pass through generic parameters from the enum.

#[derive(Debug, EnumTryAs)]
    pub enum ConstantInfo<'a> {
        Utf8(bumpalo::collections::String<'a>),
    }

generates

impl ConstantInfo {
    #[must_use]
    #[inline]
    pub fn try_as_utf_8(self) -> ::core::option::Option<(bumpalo::collections::String<'a>)> {
        match self {
            ConstantInfo::Utf8(x) => Some((x)),
            _ => None,
        }
    }
    ...
}

which doesn't compile.

@Peternator7 Peternator7 merged commit 9b18468 into Peternator7:master Mar 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants