]> Untitled Git - lemmy.git/commitdiff
Fix clippy lints. (#2572)
authorDessalines <dessalines@users.noreply.github.com>
Mon, 21 Nov 2022 10:21:09 +0000 (05:21 -0500)
committerGitHub <noreply@github.com>
Mon, 21 Nov 2022 10:21:09 +0000 (10:21 +0000)
* Fix clippy lints.

* Fix fmt.

* Dont use cargo-workspaces for fix-clippy script.

crates/api_crud/src/site/update.rs
crates/db_schema/src/impls/tagline.rs
scripts/fix-clippy.sh

index 40a356b6dde1e4663a544b2c59313a12ccbbe246..632c55f3d27b029b5e3afcf1a2143a04a9de22d6 100644 (file)
@@ -176,7 +176,7 @@ impl PerformCrud for EditSite {
         .map_err(|e| LemmyError::from_error_message(e, "couldnt_set_all_email_verified"))?;
     }
 
-    let taglines = data.taglines.to_owned();
+    let taglines = data.taglines.clone();
     Tagline::replace(context.pool(), local_site.id, taglines).await?;
 
     let site_view = SiteView::read_local(context.pool()).await?;
index 3696ac5779d80dd0d2cc27411db81ca421a85866..a41005239f93659144a1f9a69049b8f1fd1753e8 100644 (file)
@@ -1,7 +1,7 @@
 use crate::{
   newtypes::LocalSiteId,
-  schema::tagline::dsl::*,
-  source::tagline::*,
+  schema::tagline::dsl::{local_site_id, tagline},
+  source::tagline::{Tagline, TaglineForm},
   utils::{get_conn, DbPool},
 };
 use diesel::{insert_into, result::Error, ExpressionMethods, QueryDsl};
@@ -45,7 +45,6 @@ impl Tagline {
     diesel::delete(tagline).execute(conn).await
   }
   pub async fn get_all(pool: &DbPool, for_local_site_id: LocalSiteId) -> Result<Vec<Self>, Error> {
-    use crate::schema::tagline::dsl::*;
     let conn = &mut get_conn(pool).await?;
     tagline
       .filter(local_site_id.eq(for_local_site_id))
index 27b88ceddcf252f8f0ddf1731cec847c3ce0ddbb..3ad68bcd6dd13ca69d8e62948ebef99b52a0fa18 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 set -e
 
-cargo workspaces exec cargo clippy --fix --allow-dirty --tests --all-targets --all-features -- \
+cargo clippy --workspace --fix --allow-dirty --tests --all-targets --all-features -- \
     -D warnings -D deprecated -D clippy::perf -D clippy::complexity \
     -D clippy::dbg_macro -D clippy::inefficient_to_string \
     -D clippy::items-after-statements -D clippy::implicit_clone \