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

why no Parser::default() #51

Closed
zahash opened this issue Feb 24, 2024 · 3 comments
Closed

why no Parser::default() #51

zahash opened this issue Feb 24, 2024 · 3 comments

Comments

@zahash
Copy link

zahash commented Feb 24, 2024

instead of Parser::new(ParserConfig::default())
why not Parser::default()

impl Default for Parser<Infallible> {
    fn default() -> Self {
        Self {
            config: ParserConfig::default(),
        }
    }
}
zahash added a commit to zahash/rstml that referenced this issue Feb 24, 2024
@vldm
Copy link
Collaborator

vldm commented Feb 26, 2024

Usually when you need Parser, you also need to customize config. But if you create a pr, I will accept it.

@zahash
Copy link
Author

zahash commented Feb 26, 2024

@vldm
already made one 😊

#52

@zahash
Copy link
Author

zahash commented Feb 26, 2024

Default is implemented only for ParserConfig<Infallible> so i also implemented Default only for Parser<Infallible>

vldm pushed a commit that referenced this issue Feb 26, 2024
@vldm vldm closed this as completed Feb 28, 2024
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

No branches or pull requests

2 participants