mirror of https://github.com/fafhrd91/actix-web
fix a couple of doc test by using async api
This commit is contained in:
parent
8bc92b764f
commit
cba70f682a
|
@ -66,7 +66,7 @@ impl Default for Flags {
|
||||||
///
|
///
|
||||||
/// #[get("/")]
|
/// #[get("/")]
|
||||||
/// async fn index() -> impl Responder {
|
/// async fn index() -> impl Responder {
|
||||||
/// NamedFile::open("./static/index.html")
|
/// NamedFile::open_async("./static/index.html").await
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub struct NamedFile {
|
pub struct NamedFile {
|
||||||
|
@ -275,8 +275,8 @@ impl NamedFile {
|
||||||
/// # use std::io;
|
/// # use std::io;
|
||||||
/// use actix_files::NamedFile;
|
/// use actix_files::NamedFile;
|
||||||
///
|
///
|
||||||
/// # fn path() -> io::Result<()> {
|
/// # async fn path() -> io::Result<()> {
|
||||||
/// let file = NamedFile::open("test.txt")?;
|
/// let file = NamedFile::open_async("test.txt").await?;
|
||||||
/// assert_eq!(file.path().as_os_str(), "foo.txt");
|
/// assert_eq!(file.path().as_os_str(), "foo.txt");
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
|
|
Loading…
Reference in New Issue