Skip to main content

opensmiles/error/
bond.rs

1use thiserror::Error;
2
3/// Errors that can occur when creating or manipulating an atom.
4#[derive(Debug, Clone, PartialEq, Error)]
5pub enum BondError {
6    /// The specified bond is not recognized.
7    #[error("unknown bond: '{0}'")]
8    UnknownBond(char),
9}
10
11#[cfg(test)]
12mod tests {
13    use super::*;
14
15    #[test]
16    fn error_messages_are_descriptive() {
17        assert_eq!(BondError::UnknownBond('X').to_string(), "unknown bond: 'X'");
18    }
19}