Skip to content

Commit

Permalink
feat!(derive): no push for repeated enum fields
Browse files Browse the repository at this point in the history
With OpenEnum wrapping the scalar values, the push method
no longer provides enough utility.
  • Loading branch information
mzabaluev committed Nov 12, 2024
1 parent 0c28bd5 commit f76175a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions prost-derive/src/field/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ impl Field {
"Returns an iterator which yields the valid enum values contained in `{}`.",
ident_str,
);
let push = Ident::new(&format!("push_{}", ident_str), Span::call_site());
let push_doc = format!("Appends the provided enum value to `{}`.", ident_str);
let wrapped_ty = quote!(::prost::OpenEnum<#ty>);
Some(quote! {
#[doc=#iter_doc]
Expand All @@ -301,10 +299,6 @@ impl Field {
> {
self.#ident.iter().cloned().filter_map(|x| { x.known() })
}
#[doc=#push_doc]
pub fn #push(&mut self, value: #ty) {
self.#ident.push(value.into());
}
})
}
_ => None,
Expand Down

0 comments on commit f76175a

Please sign in to comment.