Spaces:
Runtime error
Runtime error
Merge pull request #50 from XFFXFF/ci_format_and_clippy
Browse filesfix: add missing format and clippy checks to the CI jobs
.github/workflows/rust_format.yml
CHANGED
@@ -19,7 +19,16 @@ jobs:
|
|
19 |
profile: minimal
|
20 |
toolchain: stable
|
21 |
components: rustfmt, clippy
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
- name: Run cargo check
|
24 |
uses: actions-rs/cargo@v1
|
25 |
with:
|
|
|
19 |
profile: minimal
|
20 |
toolchain: stable
|
21 |
components: rustfmt, clippy
|
22 |
+
- name: Format
|
23 |
+
uses: actions-rs/cargo@v1
|
24 |
+
with:
|
25 |
+
command: fmt
|
26 |
+
args: -- --check
|
27 |
+
- name: Clippy
|
28 |
+
uses: actions-rs/cargo@v1
|
29 |
+
with:
|
30 |
+
command: clippy
|
31 |
+
args: --all-features --all-targets --all
|
32 |
- name: Run cargo check
|
33 |
uses: actions-rs/cargo@v1
|
34 |
with:
|
src/cache/mod.rs
CHANGED
@@ -1 +1 @@
|
|
1 |
-
pub mod cacher;
|
|
|
1 |
+
pub mod cacher;
|
src/search_results_handler/aggregation_models.rs
CHANGED
@@ -116,7 +116,7 @@ impl RawSearchResult {
|
|
116 |
}
|
117 |
}
|
118 |
|
119 |
-
/// A named struct to store, serialize, deserialize the all the search results scraped and
|
120 |
/// aggregated from the upstream search engines.
|
121 |
///
|
122 |
/// # Fields
|
|
|
116 |
}
|
117 |
}
|
118 |
|
119 |
+
/// A named struct to store, serialize, deserialize the all the search results scraped and
|
120 |
/// aggregated from the upstream search engines.
|
121 |
///
|
122 |
/// # Fields
|
src/server/routes.rs
CHANGED
@@ -81,10 +81,10 @@ pub async fn search(
|
|
81 |
.insert_header(("location", "/"))
|
82 |
.finish())
|
83 |
} else {
|
84 |
-
let page_url: String;
|
85 |
|
86 |
// ...
|
87 |
-
|
88 |
let page = match params.page {
|
89 |
Some(page_number) => {
|
90 |
if page_number <= 1 {
|
@@ -98,7 +98,7 @@ pub async fn search(
|
|
98 |
"http://{}:{}/search?q={}&page={}",
|
99 |
config.binding_ip_addr, config.port, query, page_number
|
100 |
);
|
101 |
-
|
102 |
page_number
|
103 |
}
|
104 |
}
|
@@ -110,11 +110,11 @@ pub async fn search(
|
|
110 |
req.uri(),
|
111 |
1
|
112 |
);
|
113 |
-
|
114 |
1
|
115 |
}
|
116 |
};
|
117 |
-
|
118 |
// fetch the cached results json.
|
119 |
let cached_results_json = redis_cache.cached_results_json(&page_url);
|
120 |
// check if fetched results was indeed fetched or it was an error and if so
|
|
|
81 |
.insert_header(("location", "/"))
|
82 |
.finish())
|
83 |
} else {
|
84 |
+
let page_url: String; // Declare the page_url variable without initializing it
|
85 |
|
86 |
// ...
|
87 |
+
|
88 |
let page = match params.page {
|
89 |
Some(page_number) => {
|
90 |
if page_number <= 1 {
|
|
|
98 |
"http://{}:{}/search?q={}&page={}",
|
99 |
config.binding_ip_addr, config.port, query, page_number
|
100 |
);
|
101 |
+
|
102 |
page_number
|
103 |
}
|
104 |
}
|
|
|
110 |
req.uri(),
|
111 |
1
|
112 |
);
|
113 |
+
|
114 |
1
|
115 |
}
|
116 |
};
|
117 |
+
|
118 |
// fetch the cached results json.
|
119 |
let cached_results_json = redis_cache.cached_results_json(&page_url);
|
120 |
// check if fetched results was indeed fetched or it was an error and if so
|