diff --git a/site/guide/10-pastebin.md b/site/guide/10-pastebin.md index a104a252..5ddb9296 100644 --- a/site/guide/10-pastebin.md +++ b/site/guide/10-pastebin.md @@ -414,12 +414,13 @@ the `retrieve` route, preventing attacks on the `retrieve` route: ```rust # #[macro_use] extern crate rocket; +# use std::borrow::Cow; # use rocket::tokio::fs::File; -# type PasteId = usize; +# type PasteId<'a> = Cow<'a, str>; #[get("/")] -async fn retrieve(id: PasteId) -> Option { +async fn retrieve(id: PasteId<'_>) -> Option { let filename = format!("upload/{id}", id = id); File::open(&filename).await.ok() }