shadow_crypt_core/
algorithm.rs

1use std::fmt::Display;
2
3#[derive(Debug, PartialEq)]
4pub enum Algorithm {
5    XChaCha20Poly1305,
6}
7
8impl Display for Algorithm {
9    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10        match self {
11            Algorithm::XChaCha20Poly1305 => write!(f, "XChaCha20-Poly1305"),
12        }
13    }
14}
15
16#[cfg(test)]
17mod tests {
18    use super::*;
19
20    #[test]
21    fn test_algorithm_display() {
22        assert_eq!(
23            format!("{}", Algorithm::XChaCha20Poly1305),
24            "XChaCha20-Poly1305"
25        );
26    }
27}