Skip to content

Commit

Permalink
Add missing non_exhaustive enum variant constructors to SlashArgError
Browse files Browse the repository at this point in the history
  • Loading branch information
webmsgr committed Dec 30, 2023
1 parent 6167311 commit 002893a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/slash_argument/slash_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ impl SlashArgError {
Self::CommandStructureMismatch { description }
}

pub fn new_parse(error: Box<dyn std::error::Error + Send + Sync>, input: String) -> Self {
Self::Parse { error, input }
}

pub fn new_invalid(description: &'static str) -> Self {
Self::Invalid(description)
}

pub fn to_framework_error<U, E>(
self,
ctx: crate::ApplicationContext<'_, U, E>,
Expand Down

0 comments on commit 002893a

Please sign in to comment.