Skip to content

Commit

Permalink
Impl Deref for enum options
Browse files Browse the repository at this point in the history
  • Loading branch information
shanretoo committed May 25, 2024
1 parent 53a2a22 commit 7b639c9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/parse/text/simple_extensions/argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//! Parsing of [simple_extensions::ArgumentsItem].
use std::collections::HashSet;
use std::{collections::HashSet, ops::Deref};

use thiserror::Error;

Expand Down Expand Up @@ -163,6 +163,14 @@ impl From<EnumerationArg> for ArgumentsItem {
#[derive(Clone, Debug, PartialEq)]
pub struct EnumOptions(HashSet<String>);

impl Deref for EnumOptions {
type Target = HashSet<String>;

fn deref(&self) -> &Self::Target {
&self.0
}
}

impl<C: Context> Parse<C> for simple_extensions::EnumOptions {
type Parsed = EnumOptions;

Expand Down

0 comments on commit 7b639c9

Please sign in to comment.