Skip to content

Commit

Permalink
Fix clippys
Browse files Browse the repository at this point in the history
  • Loading branch information
sigaloid committed May 29, 2024
1 parent 33411a7 commit 6b11d93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
if path.contains("+") {
user_agent = user_agent.replace("Android", "Android");
if path.contains('+') {
user_agent = user_agent.replace("Android", "Andr\u{200B}oid");
}

// Build request to Reddit. When making a GET, request gzip compression.
Expand Down
6 changes: 3 additions & 3 deletions src/duplicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
}

if have_after {
before = "t3_".to_owned();
"t3_".clone_into(&mut before);
before.push_str(&duplicates[0].id);
}

Expand All @@ -161,7 +161,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
if have_before {
// The next batch will need to start from one after the
// last post in the current batch.
after = "t3_".to_owned();
"t3_".clone_into(&mut after);
after.push_str(&duplicates[l - 1].id);

// Here is where things get terrible. Notice that we
Expand All @@ -182,7 +182,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
match json(new_path, true).await {
Ok(response) => {
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);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

use brotli::enc::{BrotliCompress, BrotliEncoderParams};
use cached::proc_macro::cached;
use cookie::Cookie;
Expand Down

0 comments on commit 6b11d93

Please sign in to comment.