Fix clippy lints. (#2572)

* Fix clippy lints.

* Fix fmt.

* Dont use cargo-workspaces for fix-clippy script.
This commit is contained in:
Dessalines 2022-11-21 05:21:09 -05:00 committed by GitHub
parent c27d2a5687
commit 65041a20bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -176,7 +176,7 @@ impl PerformCrud for EditSite {
.map_err(|e| LemmyError::from_error_message(e, "couldnt_set_all_email_verified"))?; .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?; Tagline::replace(context.pool(), local_site.id, taglines).await?;
let site_view = SiteView::read_local(context.pool()).await?; let site_view = SiteView::read_local(context.pool()).await?;

View File

@ -1,7 +1,7 @@
use crate::{ use crate::{
newtypes::LocalSiteId, newtypes::LocalSiteId,
schema::tagline::dsl::*, schema::tagline::dsl::{local_site_id, tagline},
source::tagline::*, source::tagline::{Tagline, TaglineForm},
utils::{get_conn, DbPool}, utils::{get_conn, DbPool},
}; };
use diesel::{insert_into, result::Error, ExpressionMethods, QueryDsl}; use diesel::{insert_into, result::Error, ExpressionMethods, QueryDsl};
@ -45,7 +45,6 @@ impl Tagline {
diesel::delete(tagline).execute(conn).await diesel::delete(tagline).execute(conn).await
} }
pub async fn get_all(pool: &DbPool, for_local_site_id: LocalSiteId) -> Result<Vec<Self>, Error> { 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?; let conn = &mut get_conn(pool).await?;
tagline tagline
.filter(local_site_id.eq(for_local_site_id)) .filter(local_site_id.eq(for_local_site_id))

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e 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 warnings -D deprecated -D clippy::perf -D clippy::complexity \
-D clippy::dbg_macro -D clippy::inefficient_to_string \ -D clippy::dbg_macro -D clippy::inefficient_to_string \
-D clippy::items-after-statements -D clippy::implicit_clone \ -D clippy::items-after-statements -D clippy::implicit_clone \