fix a couple of doc test by using async api

This commit is contained in:
fakeshadow 2021-10-17 21:48:41 +08:00
parent 8bc92b764f
commit cba70f682a
1 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ impl Default for Flags {
///
/// #[get("/")]
/// async fn index() -> impl Responder {
/// NamedFile::open("./static/index.html")
/// NamedFile::open_async("./static/index.html").await
/// }
/// ```
pub struct NamedFile {
@ -275,8 +275,8 @@ impl NamedFile {
/// # use std::io;
/// use actix_files::NamedFile;
///
/// # fn path() -> io::Result<()> {
/// let file = NamedFile::open("test.txt")?;
/// # async fn path() -> io::Result<()> {
/// let file = NamedFile::open_async("test.txt").await?;
/// assert_eq!(file.path().as_os_str(), "foo.txt");
/// # Ok(())
/// # }