fn decipher(&self, ctext: &str) -> CipherResult {
        input::is_alpha(ctext)?;

        let ctext = ctext.to_ascii_uppercase();
        let ptext = ctext
            .bytes()
            .map(move |c| (c + (26 - self.key) - 65) % 26 + 65)
            .collect();

        Ok(String::from_utf8(ptext).unwrap())
    }
/// Deciphers the given ciphertext (a str reference) using the Caesar cipher
/// and returns the plaintext as a `CipherResult`.
///
/// # Example
/// ```
/// use ciphers::{Cipher, Caesar};
///
/// let caesar = Caesar::new(1);
///
/// let ptext = caesar.decipher("EFGFOEUIFFBTUXBMMPGUIFDBTUMF");
/// assert_eq!(ptext.unwrap(), "DEFENDTHEEASTWALLOFTHECASTLE");
/// ```
Deciphers the given ciphertext (a str reference) using the Caesar cipher
and returns the plaintext as a `CipherResult`.
Deciphers the given ciphertext ( a str reference ) using the Caesar cipher and returns the plaintext as a ` CipherResult ` .
fn decipher(&self, ctext: &str) -> CipherResult {
        input::is_alpha(ctext)?;
        let ctext = ctext.to_ascii_uppercase();
        let ptext = ctext
            .bytes()
            .map(move |c| (c + (26 - self.key) - 65) % 26 + 65)
            .collect();
        Ok(String::from_utf8(ptext).unwrap())
    }
fn decipher ( & self , ctext : & str ) -> CipherResult { input :: is_alpha ( ctext ) ? ; let ctext = ctext . to_ascii_uppercase ( ) ; let ptext = ctext . bytes ( ) . map ( move | c | ( c + ( 26 - self . key ) - 65 ) % 26 + 65 ) . collect ( ) ; Ok ( String :: from_utf8 ( ptext ) . unwrap ( ) ) }
Deciphers the given ciphertext (a str reference) using the Caesar cipher
and returns the plaintext as a `CipherResult`.
Deciphers the given ciphertext ( a str reference ) using the Caesar cipher and returns the plaintext as a ` CipherResult ` .
&self
ctext
&str
&self
ctext
&str
example
```
use ciphers::{Cipher, Caesar}.

let caesar = Caesar::new(1).

let ptext = caesar.decipher("EFGFOEUIFFBTUXBMMPGUIFDBTUMF");
assert_eq!(ptext.unwrap(), "DEFENDTHEEASTWALLOFTHECASTLE");
```
` ` ` use ciphers :: { Cipher Caesar } . let caesar = Caesar :: new ( 1 ) . let ptext = caesar . decipher ( " EFGFOEUIFFBTUXBMMPGUIFDBTUMF " ) ; assert_eq! ( ptext . unwrap () " DEFENDTHEEASTWALLOFTHECASTLE " ) ; ` ` `