Matching brackets in Rust I implemented the solution to the classic Matching Brackets problem:
Given a string containing brackets [], braces {}, parentheses (), or any combination thereof, verify that any pairs are matched and nested correctly.
The code should be correct since it passes several test cases.
I would like to know if:

the usage of the enum Bracket is an idiomatic construct or a useless complexity
the function brackets_are_balanced can be simplified while keeping the enum Bracket
further improvement/suggestions

#![warn(missing_crate_level_docs)]
#![warn(missing_docs)]
//! # Matching Brackets
//!
//! `matching_brackets` is a collection of utilities to solve [this exercise](https://exercism.io/my/solutions/8ecfdc024536471a8c36ac2a3ff4b119).

enum Bracket {
    OPEN(char),
    CLOSE(char),
}

impl Bracket {
    pub fn new(c: char) -&gt; Option&lt;Bracket&gt; {
        match c {
            '{' | '[' | '(' =&gt; Some(Bracket::OPEN(c)),
            '}' =&gt; Some(Bracket::CLOSE('{')),
            ']' =&gt; Some(Bracket::CLOSE('[')),
            ')' =&gt; Some(Bracket::CLOSE('(')),
            _ =&gt; None,
        }
    }
}

/// Check if the input `string` has balanced brackets.
///
/// # Examples
///
/// ```rust
/// use matching_brackets::brackets_are_balanced;
/// assert!(brackets_are_balanced(&quot;(((185 + 223.85) * 15) - 543)/2&quot;));
/// assert!(brackets_are_balanced(&quot;([{}({}[])])&quot;));
/// assert!(!brackets_are_balanced(&quot;{[)][]}&quot;))
/// ```
pub fn brackets_are_balanced(string: &amp;str) -&gt; bool {
    let mut brackets: Vec&lt;Bracket&gt; = vec![];
    for c in string.chars() {
        match Bracket::new(c) {
            Some(Bracket::OPEN(char_bracket)) =&gt; {
                brackets.push(Bracket::OPEN(char_bracket));
            }
            Some(Bracket::CLOSE(char_close_bracket)) =&gt; match brackets.pop() {
                Some(Bracket::OPEN(char_open_bracket)) =&gt; {
                    if char_close_bracket != char_open_bracket {
                        return false;
                    }
                }
                _ =&gt; return false,
            },
            _ =&gt; (),
        };
    }
    brackets.is_empty()
}
the introduction of enum Bracket is good and idiomatic. However, this is not the only useful form, there are at least 2 other forms that would work just fine.
brackets_are_balanced can be simplified when we notice that all Brackets in Vec&lt;Bracket&gt; are of the Open variant, so we do not need to store Brackets, just their chars.
the introduction of fn new is against standard practice. A conversion constructor should not be called fn new and every constructor should return only Self (= Bracket). That's why the function should be renamed to from_char.
it's common practice to name enum variants with PascalCase, in your program, Bracket::Open and Bracket::Close. Not sure why you did all uppercase.
the result of brackets.pop() does not need matching, it can be simply compared.

The refactored code is
#![warn(missing_crate_level_docs)]
#![warn(missing_docs)]
//! # Matching Brackets
//!
//! `matching_brackets` is a collection of utilities to solve [this exercise](https://exercism.io/my/solutions/8ecfdc024536471a8c36ac2a3ff4b119).

enum Bracket {
    Open(char),
    Close(char),
}

impl Bracket {
    pub fn from_char(c: char) -&gt; Option&lt;Bracket&gt; {
        match c {
            '{' | '[' | '(' =&gt; Some(Bracket::Open(c)),
            '}' =&gt; Some(Bracket::Close('{')),
            ']' =&gt; Some(Bracket::Close('[')),
            ')' =&gt; Some(Bracket::Close('(')),
            _ =&gt; None,
        }
    }
}

/// Check if the input `string` has balanced brackets.
///
/// # Examples
///
/// ```rust
/// use matching_brackets::brackets_are_balanced;
/// assert!(brackets_are_balanced(&quot;(((185 + 223.85) * 15) - 543)/2&quot;));
/// assert!(brackets_are_balanced(&quot;([{}({}[])])&quot;));
/// assert!(!brackets_are_balanced(&quot;{[)][]}&quot;))
/// ```
pub fn brackets_are_balanced(string: &amp;str) -&gt; bool {
    let mut brackets: Vec&lt;char&gt; = vec![];
    for c in string.chars() {
        match Bracket::from_char(c) {
            Some(Bracket::Open(char_bracket)) =&gt; {
                brackets.push(char_bracket);
            }
            Some(Bracket::Close(char_close_bracket)) =&gt; {
                if brackets.pop() != Some(char_close_bracket) {
                    return false;
                }
            }
            _ =&gt; {}
        }
    }
    brackets.is_empty()
}
```