Skip to content

Commit 5ad0903

Browse files
committed
fix clippy error
1 parent f260853 commit 5ad0903

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/fs/serve_dir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use crate::{Body, Endpoint, Request, Response, Result, StatusCode};
33

44
use async_std::path::PathBuf as AsyncPathBuf;
55

6-
use std::{ffi::OsStr, io};
76
use std::path::{Path, PathBuf};
7+
use std::{ffi::OsStr, io};
88

99
pub(crate) struct ServeDir {
1010
prefix: String,
@@ -51,7 +51,7 @@ where
5151
log::warn!("File not found: {:?}", &file_path);
5252
Ok(Response::new(StatusCode::NotFound))
5353
}
54-
Err(e) => Err(e)?,
54+
Err(e) => Err(e.into()),
5555
}
5656
}
5757
}

src/fs/serve_file.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::path::Path;
66
use async_std::path::PathBuf as AsyncPathBuf;
77
use async_trait::async_trait;
88

9-
pub struct ServeFile {
9+
pub(crate) struct ServeFile {
1010
path: AsyncPathBuf,
1111
}
1212

@@ -29,7 +29,7 @@ impl<State: Clone + Send + Sync + 'static> Endpoint<State> for ServeFile {
2929
log::warn!("File not found: {:?}", &self.path);
3030
Ok(Response::new(StatusCode::NotFound))
3131
}
32-
Err(e) => Err(e)?,
32+
Err(e) => Err(e.into()),
3333
}
3434
}
3535
}

0 commit comments

Comments
 (0)