Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherBiscardi committed Feb 28, 2024
1 parent 739e45b commit 1003161
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 36 deletions.
12 changes: 3 additions & 9 deletions src/app/routes/admin/devlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ async fn add_devlog(

#[component]
pub fn Devlog() -> impl IntoView {
let add_devlog =
create_server_action::<AddDevlog>();
let add_devlog = create_server_action::<AddDevlog>();
let devlogs = create_resource(
move || {},
|_| join(fetch_devlogs(), fetch_issues()),
Expand Down Expand Up @@ -188,9 +187,7 @@ fn AddDevlogToIssueForm(
issue_id: Option<String>,
) -> impl IntoView {
let associate_devlog_with_issue =
create_server_action::<
AssociateDevlogWithIssue,
>();
create_server_action::<AssociateDevlogWithIssue>();

view! {
<li class="flex items-center justify-between gap-x-6 py-5">
Expand Down Expand Up @@ -287,10 +284,7 @@ ORDER BY devlog.id"
.fetch_all(&pool)
.await?;

Ok(devlogs
.into_iter()
.map(DevlogData::from)
.collect())
Ok(devlogs.into_iter().map(DevlogData::from).collect())
}

#[server]
Expand Down
16 changes: 5 additions & 11 deletions src/app/routes/admin/devlog/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ async fn update_devlog(
.parse::<rusty_ulid::Ulid>()
.map_err(|_| {
ServerFnError::<NoCustomError>::ServerError(
"expected a valid devlog id"
.to_string(),
"expected a valid devlog id".to_string(),
)
})?
.into();
Expand Down Expand Up @@ -415,8 +414,7 @@ async fn associate_image_with_devlog(
.parse::<rusty_ulid::Ulid>()
.map_err(|_| {
ServerFnError::<NoCustomError>::ServerError(
"expected a valid devlog id"
.to_string(),
"expected a valid devlog id".to_string(),
)
})?
.into();
Expand Down Expand Up @@ -460,8 +458,7 @@ async fn remove_image_from_devlog(
.parse::<rusty_ulid::Ulid>()
.map_err(|_| {
ServerFnError::<NoCustomError>::ServerError(
"expected a valid devlog id"
.to_string(),
"expected a valid devlog id".to_string(),
)
})?
.into();
Expand Down Expand Up @@ -537,8 +534,7 @@ fn DevlogImageLi(
url: String,
) -> impl IntoView {
let remove_image_from_devlog =
create_server_action::<RemoveImageFromDevlog>(
);
create_server_action::<RemoveImageFromDevlog>();

view! {
<li class="relative">
Expand Down Expand Up @@ -578,9 +574,7 @@ fn ImageLi(
description: String,
) -> impl IntoView {
let associate_image_with_devlog =
create_server_action::<
AssociateImageWithDevlog,
>();
create_server_action::<AssociateImageWithDevlog>();

view! {
<li class="relative">
Expand Down
12 changes: 3 additions & 9 deletions src/app/routes/admin/issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,6 @@ issue_id.as_slice()

// devlogs


#[component]
fn Devlogs() -> impl IntoView {
let params = use_params_map();
Expand Down Expand Up @@ -675,9 +674,7 @@ fn Devlogs() -> impl IntoView {
}

#[component]
fn DevlogLi(
devlog: DevlogData,
) -> impl IntoView {
fn DevlogLi(devlog: DevlogData) -> impl IntoView {
view! {
<li class="relative flex justify-between gap-x-6 px-4 py-5 hover:bg-gray-50 sm:px-6">
<div class="flex min-w-0 gap-x-4">
Expand Down Expand Up @@ -791,13 +788,10 @@ LEFT JOIN (
) AS si ON si.devlog_id = devlog.id
WHERE issue__devlog.issue_id = ?
ORDER BY devlog.posted_date",
issue_id.as_slice()
issue_id.as_slice()
)
.fetch_all(&pool)
.await?;

Ok(devlogs
.into_iter()
.map(DevlogData::from)
.collect())
Ok(devlogs.into_iter().map(DevlogData::from).collect())
}
9 changes: 2 additions & 7 deletions src/app/routes/issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ struct SqlCrateRelease {
images: Option<Vec<ImgData>>,
}


#[derive(Clone, Serialize, Deserialize)]
struct Devlog {
title: String,
Expand Down Expand Up @@ -227,8 +226,7 @@ struct SqlShowcaseData {
Option<sqlx::types::Json<Vec<ShowcaseData2>>>,
crate_releases:
Option<sqlx::types::Json<Vec<SqlCrateRelease>>>,
devlogs:
Option<sqlx::types::Json<Vec<SqlDevlog>>>,
devlogs: Option<sqlx::types::Json<Vec<SqlDevlog>>>,
new_github_issues:
Option<sqlx::types::Json<Vec<SqlNewGhIssue>>>,
new_pull_requests:
Expand Down Expand Up @@ -781,9 +779,7 @@ fn CrateReleaseView(
}

#[component]
fn DevlogView(
devlog: Devlog,
) -> impl IntoView {
fn DevlogView(devlog: Devlog) -> impl IntoView {
let mut it = devlog.images.iter();
let first_image = it.next();
view! {
Expand Down Expand Up @@ -960,7 +956,6 @@ fn VideoLink(url: String) -> impl IntoView {
}
}


#[component]
fn PostLink(url: String) -> impl IntoView {
view! {
Expand Down

0 comments on commit 1003161

Please sign in to comment.