Skip to content

Commit

Permalink
Fixes clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Sep 2, 2024
1 parent 7ab5050 commit d3af3f8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/src/services/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async fn login(
.try_get(0)
.ok_or(oxfeed_common::Error::InvalidLogin)?;

let response = actix_web::HttpResponse::Ok().json(&token.to_string());
let response = actix_web::HttpResponse::Ok().json(token.to_string());

Ok(response)
}
Expand Down
2 changes: 1 addition & 1 deletion api/src/services/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async fn content(
.next()
.ok_or(oxfeed_common::Error::NotFound)?;

Ok(actix_web::HttpResponse::Ok().json(&content.unwrap_or_default()))
Ok(actix_web::HttpResponse::Ok().json(content.unwrap_or_default()))
}

#[actix_web::patch("/{item_id}")]
Expand Down
10 changes: 6 additions & 4 deletions front/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,14 @@ pub enum Body {
Json(serde_json::Value),
}

impl ToString for Body {
fn to_string(&self) -> String {
match self {
impl std::fmt::Display for Body {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = match self {
Self::Empty => String::new(),
Self::Json(json) => json.to_string(),
}
};

f.write_str(&s)
}
}

Expand Down
1 change: 1 addition & 0 deletions front/src/components/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub fn Component() -> yew::Html {

enum Message {
Event(crate::Event),
#[allow(dead_code)]
Websocket(wasm_sockets::Message),
}

Expand Down
2 changes: 2 additions & 0 deletions front/src/components/settings/webhooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ pub enum Message {
Add,
Cancel,
Create(oxfeed_common::webhook::Entity),
#[allow(dead_code)]
Error(String),
#[allow(dead_code)]
Event(crate::Event),
NeedUpdate,
Update(Vec<oxfeed_common::webhook::Entity>),
Expand Down

0 comments on commit d3af3f8

Please sign in to comment.