Fix all default clippy warnings (#480)

All trivial, fixes were for:
 - #[deny(clippy::if_same_then_else)]
 - #[warn(clippy::explicit_auto_deref)]
 - #[warn(clippy::bool_assert_comparison)]

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Tom Martin
2022-11-17 17:09:53 +00:00
committed by GitHub
parent da19a07943
commit ba28bc94d3
26 changed files with 77 additions and 87 deletions

View File

@@ -42,7 +42,7 @@ pub async fn report_create(
let id =
crate::database::models::generate_report_id(&mut transaction).await?;
let report_type = crate::database::models::categories::ReportType::get_id(
&*new_report.report_type,
&new_report.report_type,
&mut *transaction,
)
.await?
@@ -66,7 +66,7 @@ pub async fn report_create(
match new_report.item_type {
ItemType::Project => {
report.project_id = Some(
serde_json::from_str::<ProjectId>(&*format!(
serde_json::from_str::<ProjectId>(&format!(
"\"{}\"",
new_report.item_id
))?
@@ -75,7 +75,7 @@ pub async fn report_create(
}
ItemType::Version => {
report.version_id = Some(
serde_json::from_str::<VersionId>(&*format!(
serde_json::from_str::<VersionId>(&format!(
"\"{}\"",
new_report.item_id
))?
@@ -84,7 +84,7 @@ pub async fn report_create(
}
ItemType::User => {
report.user_id = Some(
serde_json::from_str::<UserId>(&*format!(
serde_json::from_str::<UserId>(&format!(
"\"{}\"",
new_report.item_id
))?