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

chore: Derive default for a bunch of types #1931

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

larseggert
Copy link
Contributor

Which either (IMO) have a natural default, or that only consist of Options.

This makes initialization of these types less verbose for the user.

Which either (IMO) have a natural default, or that only consist of `Option`s.

This makes initialization of these types less verbose for the user.
@@ -63,7 +64,7 @@ pub enum PacketNumberSpace {
}

#[serde_with::skip_serializing_none]
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug)]
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug, Default)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larseggert larseggert changed the title chore: Derive default gor a bunch of types chore: Derive default for a bunch of types Jan 31, 2025
@larseggert
Copy link
Contributor Author

@LPardue
Copy link
Contributor

LPardue commented Jan 31, 2025

I interpret that as yes lol. If you're not using new() or with_type() and the Default impl can make more concise code in apps, perhaps we should just remove those 2 functions as well. It doesn't need to be in this PR but could be a followup the does some quiche library internal tidyup too

@larseggert
Copy link
Contributor Author

I think new wants all the info, too, and with_type doesn't have all the args for info we want.

@LPardue LPardue merged commit cba5e73 into cloudflare:master Feb 3, 2025
25 checks passed
@LPardue
Copy link
Contributor

LPardue commented Feb 3, 2025

Merged, thanks.

@larseggert larseggert deleted the chore-derive-default branch February 3, 2025 15:18
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