mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 02:25:41 +00:00
addressing clippy lints
This commit is contained in:
@@ -21,21 +21,15 @@ pub struct FileMap {
|
||||
}
|
||||
|
||||
impl FileMap {
|
||||
#[allow(clippy::new_without_default)]
|
||||
pub fn new() -> Self {
|
||||
let map = include_str!("../cache_buster_data.json");
|
||||
let files = Files::new(&map);
|
||||
Self { files }
|
||||
}
|
||||
pub fn get<'a>(&'a self, path: &'a str) -> Option<&'a str> {
|
||||
// let file_path = self.files.get(path);
|
||||
let file_path = self.files.get_full_path(path);
|
||||
|
||||
if file_path.is_some() {
|
||||
let file_path = &file_path.unwrap()[1..];
|
||||
return Some(file_path);
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
file_path.map(|file_path| &file_path[1..])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ mod tests {
|
||||
|
||||
let resp = test::call_service(
|
||||
&mut app,
|
||||
test::TestRequest::get().uri(&*crate::JS).to_request(),
|
||||
test::TestRequest::get().uri(*crate::JS).to_request(),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(resp.status(), StatusCode::OK);
|
||||
@@ -107,7 +107,7 @@ mod tests {
|
||||
let resp = test::call_service(
|
||||
&mut app,
|
||||
test::TestRequest::get()
|
||||
.uri(&*crate::VERIFICATIN_WIDGET_JS)
|
||||
.uri(*crate::VERIFICATIN_WIDGET_JS)
|
||||
.to_request(),
|
||||
)
|
||||
.await;
|
||||
@@ -116,7 +116,7 @@ mod tests {
|
||||
let resp = test::call_service(
|
||||
&mut app,
|
||||
test::TestRequest::get()
|
||||
.uri(&*crate::VERIFICATIN_WIDGET_CSS)
|
||||
.uri(*crate::VERIFICATIN_WIDGET_CSS)
|
||||
.to_request(),
|
||||
)
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user