#![feature(ascii_ctype)]
use std::ascii::AsciiExt;

pub fn rotate(text: &str, key: usize) -> String {
    const LA: u8 = b'a';
    const UA: u8 = b'A';
    text.chars()
        .map(|x| match x {
            _ if x.is_ascii_lowercase() => {
                let v = (x as u8 - LA + key as u8) % 26 + LA;
                v as char
            }
            _ if x.is_ascii_uppercase() => {
                let v = (x as u8 - UA + key as u8) % 26 + UA;
                v as char
            }
            _ => x,
        })
        .collect()
}

#![feature(ascii_ctype)]
use std::ascii::AsciiExt;

pub fn rotate(text: &str, key: usize) -> String {
    text.chars()
        .map(|x| match x {
            _ if x.is_ascii_lowercase() => {
                let v = (x as u8 - b'a' + key as u8) % 26 + b'a';
                v as char
            }
            _ if x.is_ascii_uppercase() => {
                let v = (x as u8 - b'A' + key as u8) % 26 + b'A';
                v as char
            }
            _ => x,
        })
        .collect()
}

--- 
+++ 
@@ -2,16 +2,14 @@
 use std::ascii::AsciiExt;
 
 pub fn rotate(text: &str, key: usize) -> String {
-    const LA: u8 = b'a';
-    const UA: u8 = b'A';
     text.chars()
         .map(|x| match x {
             _ if x.is_ascii_lowercase() => {
-                let v = (x as u8 - LA + key as u8) % 26 + LA;
+                let v = (x as u8 - b'a' + key as u8) % 26 + b'a';
                 v as char
             }
             _ if x.is_ascii_uppercase() => {
-                let v = (x as u8 - UA + key as u8) % 26 + UA;
+                let v = (x as u8 - b'A' + key as u8) % 26 + b'A';
                 v as char
             }
             _ => x,
Use const instead of magic number

It looks better
