cli lab1
This commit is contained in:
@@ -6,8 +6,8 @@ pub struct CaesarCipher {
|
||||
}
|
||||
|
||||
impl CaesarCipher {
|
||||
pub fn new(alphabet: impl Into<Vec<char>>, offset: i64) -> anyhow::Result<Self> {
|
||||
let alphabet = alphabet.into();
|
||||
pub fn new(alphabet: &str, offset: i64) -> anyhow::Result<Self> {
|
||||
let alphabet = alphabet.chars().collect::<Vec<_>>();
|
||||
let offset = offset % alphabet.len() as i64;
|
||||
|
||||
util::verify_alphabet(&alphabet)?;
|
||||
|
||||
Reference in New Issue
Block a user