From 91eda2777335202d6def8fdff4527f6240b9a0ba Mon Sep 17 00:00:00 2001 From: DD5HT Date: Sun, 22 Jul 2018 21:31:17 +0200 Subject: [PATCH] add extern crate actix_web to all samples + one missing unwrap --- content/docs/static-files.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/docs/static-files.md b/content/docs/static-files.md index 7bf387f..fcb3666 100644 --- a/content/docs/static-files.md +++ b/content/docs/static-files.md @@ -10,6 +10,7 @@ It is possible to serve static files with a custom path pattern and `NamedFile`. match a path tail, we can use a `[.*]` regex. ```rust +extern crate actix_web; use std::path::PathBuf; use actix_web::{App, HttpRequest, Result, http::Method, fs::NamedFile}; @@ -32,6 +33,7 @@ To serve files from specific directories and sub-directories, `StaticFiles` can it will be unable to serve sub-paths. ```rust +extern crate actix_web; use actix_web::{App, fs}; fn main() { @@ -39,6 +41,7 @@ fn main() { .handler( "/static", fs::StaticFiles::new(".") + .unwrap() .show_files_listing()) .finish(); }