Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
qewer33 committed Dec 11, 2022
1 parent 668e407 commit 1faab65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl UrlShortener {

let kv_result = ctx
.kv("KV")?
.put(&req_body.key.replace(" ", "-"), &req_body.url);
.put(&req_body.key.replace(' ', "-"), &req_body.url);

if let Ok(kv_result) = kv_result {
let kv_result = kv_result.execute().await;
Expand Down Expand Up @@ -94,7 +94,7 @@ impl UrlShortener {
let req_body: Result<DeleteRequest> = req.json().await;

if let Ok(req_body) = req_body {
let kv_result = ctx.kv("KV")?.delete(&req_body.key.replace(" ", "-")).await;
let kv_result = ctx.kv("KV")?.delete(&req_body.key.replace(' ', "-")).await;

if kv_result.is_ok() {
return Response::from_html("Key Successfully Deleted");
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn log_request(req: &Request) {
Date::now().to_string(),
req.path(),
req.cf().coordinates().unwrap_or_default(),
req.cf().region().unwrap_or("unknown region".into())
req.cf().region().unwrap_or_else(|| "unknown region".into())
);
}

Expand Down

0 comments on commit 1faab65

Please sign in to comment.