Skip to content

Commit

Permalink
chore: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Dec 1, 2024
1 parent 855ca29 commit 1d52ccd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/api_admin/src/routes/block_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub async fn block_url(
) -> Result<(StatusCode, Json<BlockUrlResult>), AppError> {
match &query.url {
url if url.query().is_some() => Err(AppError::new(
format!("wrong url: {} (can't contain search params)", url),
format!("wrong url: {url} (can't contain search params)"),
None,
Some(StatusCode::BAD_REQUEST),
)),
Expand Down
4 changes: 2 additions & 2 deletions crates/feed/src/user_feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ impl UserFeed {
match self {
Self {
json: Some(url), ..
} => UserFeedTopLevel::parse_json_feed(url.clone()).await,
Self {
}
| Self {
atom: Some(url), ..
} => UserFeedTopLevel::parse_xml_feed(url.clone()).await,
Self { rss: Some(url), .. } => UserFeedTopLevel::parse_xml_feed(url.clone()).await,
Expand Down
4 changes: 2 additions & 2 deletions crates/frontend/src/pages/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ pub async fn home(data: Data<AppData>) -> Markup {
.env
.hatsu_node_name
.clone()
.unwrap_or(String::from("Hatsu"));
.unwrap_or_else(|| String::from("Hatsu"));

layout(
html! {
&html! {
@if let Some(description) = &data.env.hatsu_node_description {
h2 class="md-typescale-title-large" style="margin-top: 0" { "About this instance" }
p style="margin: 0" { (description) }
Expand Down
1 change: 0 additions & 1 deletion crates/frontend/src/pages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use axum::{routing::get, Router};

mod home;

#[must_use]
pub fn routes() -> Router {
Router::new().route("/", get(home::home))
}
4 changes: 2 additions & 2 deletions crates/frontend/src/partials/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ document.adoptedStyleSheets.push(typescaleStyles.styleSheet);
}
}

pub fn layout(body: Markup, data: &Data<AppData>) -> Markup {
pub fn layout(body: &Markup, data: &Data<AppData>) -> Markup {
let title = data
.env
.hatsu_node_name
.clone()
.unwrap_or(String::from("Hatsu"));
.unwrap_or_else(|| String::from("Hatsu"));

html! {
(DOCTYPE)
Expand Down

0 comments on commit 1d52ccd

Please sign in to comment.