Created
June 17, 2017 08:00
-
-
Save andete/43aee9db7542dd8dc33d46c371a7dcbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[get("/lang/<lang>")] | |
fn lang(mut cookies: Cookies, lang: String) -> Result<Redirect> { | |
let lang:&'static str = Lang::from_str(&lang)?.into(); | |
info!("Setting language to: {}", lang); | |
cookies.add_private(Cookie::new("lang", lang)); | |
Ok(Redirect::to("/page")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment