Skip to content

Commit

Permalink
Remove redundant clones
Browse files Browse the repository at this point in the history
  • Loading branch information
randomairborne committed Feb 14, 2024
1 parent eed118b commit 91509b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async fn home(
let accept = headers
.get("Accept")
.map_or("*/*", |x| x.to_str().unwrap_or("invalid header value"));
let ip = get_ip(sock_addr, &headers, state.clone())?;
let ip = get_ip(sock_addr, &headers, state)?;
if accept.contains("text/html") {
Ok(HtmlOrRaw::Html(include_str!("index.html")))
} else {
Expand All @@ -64,7 +64,7 @@ async fn raw(
headers: HeaderMap,
State(state): State<AppState>,
) -> Result<String, Error> {
let ip = get_ip(sock_addr, &headers, state.clone())?;
let ip = get_ip(sock_addr, &headers, state)?;
Ok(format!("{ip}\n"))
}

Expand Down

0 comments on commit 91509b0

Please sign in to comment.