-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
The #[serde(borrow)]
attribute is a per-variant field.
However, it seems to be applied incorrectly/inconsistently by the code generated by the type-generator
. I am not sure if I'm missing a nuance here, but to illustrate:
pub enum Schema<'a> {
#[serde(borrow = "'a")]
BranchProtectionRuleEvent(BranchProtectionRuleEvent<'a>), // only the first variant has the `#[serde(borrow)]` attribute.
CheckRunEvent(CheckRunEvent<'a>),
....
}
pub enum BranchProtectionRuleEvent<'a> {
#[serde(borrow = "'a")]
Created(BranchProtectionRuleCreatedEvent<'a>), // Again, only this variant has the `[serde(borrow)]` attribute
Deleted(BranchProtectionRuleDeletedEvent<'a>),
Edited(BranchProtectionRuleEditedEvent<'a>),
}
pub enum CheckRunEvent<'a> {
#[serde(borrow = "'a")]
Completed(CheckRunCompletedEvent<'a>), // This has the borrow attribute, but the parent in Schema does not
Created(CheckRunCreatedEvent<'a>),
RequestedAction(CheckRunRequestedActionEvent<'a>),
Rerequested(CheckRunRerequestedEvent<'a>),
}
Metadata
Metadata
Assignees
Labels
No labels