Skip to content

Commit

Permalink
non exhaustive error enum
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Jul 29, 2020
1 parent 4384832 commit 01abba2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions derive_builder_core/src/builder.rs
Expand Up @@ -44,6 +44,7 @@ use Setter;
///
/// #[doc="Error type for FooBuilder"]
/// #[derive(Debug)]
/// #[non_exhaustive]
/// pub enum FooBuilderError {
/// /// Uninitialized field
/// UninitializedField(&'static str),
Expand Down Expand Up @@ -181,6 +182,7 @@ impl<'a> ToTokens for Builder<'a> {

#[doc=#builder_error_doc]
#[derive(Debug)]
#[non_exhaustive]
#builder_vis enum #builder_error_ident {
/// Uninitialized field
UninitializedField(&'static str),
Expand Down Expand Up @@ -334,6 +336,7 @@ mod tests {
result.append_all(quote!(
#[doc="Error type for FooBuilder"]
#[derive(Debug)]
#[non_exhaustive]
pub enum FooBuilderError {
/// Uninitialized field
UninitializedField(&'static str),
Expand Down Expand Up @@ -414,6 +417,7 @@ mod tests {
result.append_all(quote!(
#[doc="Error type for FooBuilder"]
#[derive(Debug)]
#[non_exhaustive]
pub enum FooBuilderError {
/// Uninitialized field
UninitializedField(&'static str),
Expand Down Expand Up @@ -494,6 +498,7 @@ mod tests {
result.append_all(quote!(
#[doc="Error type for FooBuilder"]
#[derive(Debug)]
#[non_exhaustive]
pub enum FooBuilderError {
/// Uninitialized field
UninitializedField(&'static str),
Expand Down Expand Up @@ -578,6 +583,7 @@ mod tests {
result.append_all(quote!(
#[doc="Error type for FooBuilder"]
#[derive(Debug)]
#[non_exhaustive]
pub enum FooBuilderError {
/// Uninitialized field
UninitializedField(&'static str),
Expand Down Expand Up @@ -659,6 +665,7 @@ mod tests {
result.append_all(quote!(
#[doc="Error type for FooBuilder"]
#[derive(Debug)]
#[non_exhaustive]
pub enum FooBuilderError {
/// Uninitialized field
UninitializedField(&'static str),
Expand Down

0 comments on commit 01abba2

Please sign in to comment.