Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The `#[derive(::prost::Enumeration)]` annotation added to the generated

```rust,ignore
impl PhoneType {
pub fn is_valid(value: i32) -> bool { ... }
pub const fn is_valid(value: i32) -> bool { ... }
#[deprecated]
pub fn from_i32(value: i32) -> Option<PhoneType> { ... }
}
Expand Down
2 changes: 1 addition & 1 deletion prost-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ fn try_enumeration(input: TokenStream) -> Result<TokenStream, Error> {
let expanded = quote! {
impl #impl_generics #ident #ty_generics #where_clause {
#[doc=#is_valid_doc]
pub fn is_valid(value: i32) -> bool {
pub const fn is_valid(value: i32) -> bool {
match value {
#(#is_valid,)*
_ => false,
Expand Down
2 changes: 1 addition & 1 deletion prost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The `#[derive(::prost::Enumeration)]` annotation added to the generated

```rust,ignore
impl PhoneType {
pub fn is_valid(value: i32) -> bool { ... }
pub const fn is_valid(value: i32) -> bool { ... }
#[deprecated]
pub fn from_i32(value: i32) -> Option<PhoneType> { ... }
}
Expand Down
Loading