From 0f5e08d477d495b875b955a79f6836224ef2351f Mon Sep 17 00:00:00 2001 From: Ali MJ Al-Nasrawy Date: Wed, 23 Jun 2021 21:22:52 +0300 Subject: [PATCH] fix docs --- actix-files/src/files.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/actix-files/src/files.rs b/actix-files/src/files.rs index e04d1e134..49d81eb03 100644 --- a/actix-files/src/files.rs +++ b/actix-files/src/files.rs @@ -167,17 +167,20 @@ impl Files { /// However, the real path may not exist since the filter is called before checking path existence. /// /// When a path doesn't pass the filter, [`Files::default_handler`] is called if set, otherwise, - /// `404 NotFound` is returned. + /// `404 Not Found` is returned. + /// + /// # Examples /// ``` /// use std::path::Path; /// use actix_files::Files; /// + /// // prevent searching subdirectories and following symlinks /// let files_service = Files::new("/", "./static").path_filter(|path, _| { - /// path.components.count() == 1 + /// path.components().count() == 1 /// && Path::new("./static") /// .join(path) /// .symlink_metadata() - /// .map(|m| m.file_type().is_symlink()) + /// .map(|m| !m.file_type().is_symlink()) /// .unwrap_or(false) /// }); /// ```