Fix clippys
This commit is contained in:
parent
33411a7588
commit
6b11d936b3
@ -182,8 +182,8 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Check if multi sub requested. If so, replace "Android" with a tricky word.
|
// Check if multi sub requested. If so, replace "Android" with a tricky word.
|
||||||
if path.contains("+") {
|
if path.contains('+') {
|
||||||
user_agent = user_agent.replace("Android", "Android");
|
user_agent = user_agent.replace("Android", "Andr\u{200B}oid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build request to Reddit. When making a GET, request gzip compression.
|
// Build request to Reddit. When making a GET, request gzip compression.
|
||||||
|
@ -151,7 +151,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if have_after {
|
if have_after {
|
||||||
before = "t3_".to_owned();
|
"t3_".clone_into(&mut before);
|
||||||
before.push_str(&duplicates[0].id);
|
before.push_str(&duplicates[0].id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
|
|||||||
if have_before {
|
if have_before {
|
||||||
// The next batch will need to start from one after the
|
// The next batch will need to start from one after the
|
||||||
// last post in the current batch.
|
// last post in the current batch.
|
||||||
after = "t3_".to_owned();
|
"t3_".clone_into(&mut after);
|
||||||
after.push_str(&duplicates[l - 1].id);
|
after.push_str(&duplicates[l - 1].id);
|
||||||
|
|
||||||
// Here is where things get terrible. Notice that we
|
// Here is where things get terrible. Notice that we
|
||||||
@ -182,7 +182,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
|
|||||||
match json(new_path, true).await {
|
match json(new_path, true).await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
if !response[1]["data"]["children"].as_array().unwrap_or(&Vec::new()).is_empty() {
|
if !response[1]["data"]["children"].as_array().unwrap_or(&Vec::new()).is_empty() {
|
||||||
before = "t3_".to_owned();
|
"t3_".clone_into(&mut before);
|
||||||
before.push_str(&duplicates[0].id);
|
before.push_str(&duplicates[0].id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use brotli::enc::{BrotliCompress, BrotliEncoderParams};
|
use brotli::enc::{BrotliCompress, BrotliEncoderParams};
|
||||||
use cached::proc_macro::cached;
|
use cached::proc_macro::cached;
|
||||||
use cookie::Cookie;
|
use cookie::Cookie;
|
||||||
|
Loading…
Reference in New Issue
Block a user