mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-21 21:48:21 -05:00
Merge pull request #50 from XFFXFF/ci_format_and_clippy
fix: add missing format and clippy checks to the CI jobs
This commit is contained in:
commit
018f92526e
11
.github/workflows/rust_format.yml
vendored
11
.github/workflows/rust_format.yml
vendored
@ -19,7 +19,16 @@ jobs:
|
|||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
|
- name: Format
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: -- --check
|
||||||
|
- name: Clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-features --all-targets --all
|
||||||
- name: Run cargo check
|
- name: Run cargo check
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
2
src/cache/mod.rs
vendored
2
src/cache/mod.rs
vendored
@ -1 +1 @@
|
|||||||
pub mod cacher;
|
pub mod cacher;
|
||||||
|
@ -116,7 +116,7 @@ impl RawSearchResult {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A named struct to store, serialize, deserialize the all the search results scraped and
|
/// A named struct to store, serialize, deserialize the all the search results scraped and
|
||||||
/// aggregated from the upstream search engines.
|
/// aggregated from the upstream search engines.
|
||||||
///
|
///
|
||||||
/// # Fields
|
/// # Fields
|
||||||
|
@ -81,10 +81,10 @@ pub async fn search(
|
|||||||
.insert_header(("location", "/"))
|
.insert_header(("location", "/"))
|
||||||
.finish())
|
.finish())
|
||||||
} else {
|
} else {
|
||||||
let page_url: String; // Declare the page_url variable without initializing it
|
let page_url: String; // Declare the page_url variable without initializing it
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
let page = match params.page {
|
let page = match params.page {
|
||||||
Some(page_number) => {
|
Some(page_number) => {
|
||||||
if page_number <= 1 {
|
if page_number <= 1 {
|
||||||
@ -98,7 +98,7 @@ pub async fn search(
|
|||||||
"http://{}:{}/search?q={}&page={}",
|
"http://{}:{}/search?q={}&page={}",
|
||||||
config.binding_ip_addr, config.port, query, page_number
|
config.binding_ip_addr, config.port, query, page_number
|
||||||
);
|
);
|
||||||
|
|
||||||
page_number
|
page_number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,11 +110,11 @@ pub async fn search(
|
|||||||
req.uri(),
|
req.uri(),
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
|
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// fetch the cached results json.
|
// fetch the cached results json.
|
||||||
let cached_results_json = redis_cache.cached_results_json(&page_url);
|
let cached_results_json = redis_cache.cached_results_json(&page_url);
|
||||||
// check if fetched results was indeed fetched or it was an error and if so
|
// check if fetched results was indeed fetched or it was an error and if so
|
||||||
|
Loading…
Reference in New Issue
Block a user