-D clippy::unused_self
-A clippy::uninlined_format_args
-D clippy::get_first
+ -D clippy::explicit_into_iter_loop
+ -D clippy::explicit_iter_loop
+ -D clippy::needless_collect
- cargo clippy --workspace --features console --
-D clippy::unwrap_used
-D clippy::indexing_slicing
for mention in mentions
.iter()
.filter(|m| m.is_local(&context.settings().hostname) && m.name.ne(&person.name))
- .collect::<Vec<&MentionData>>()
{
let mention_name = mention.name.clone();
let user_view = LocalUserView::read_from_name(context.pool(), &mention_name).await;
pub fn check_comment_depth(comment: &Comment) -> Result<(), LemmyError> {
let path = &comment.path.0;
- let length = path.split('.').collect::<Vec<&str>>().len();
+ let length = path.split('.').count();
if length > MAX_COMMENT_DEPTH_LIMIT {
Err(LemmyError::from_message("max_comment_depth_reached"))
} else {
// send to user followers
if !is_mod_action {
- inboxes.append(
+ inboxes.extend(
&mut PersonFollower::list_followers(context.pool(), actor.id)
.await?
.into_iter()
- .map(|p| ApubPerson(p).shared_inbox_or_inbox())
- .collect(),
+ .map(|p| ApubPerson(p).shared_inbox_or_inbox()),
);
}
traits::Crud,
utils::DbPool,
};
-use lemmy_utils::{
- error::LemmyError,
- utils::mention::{scrape_text_for_mentions, MentionData},
-};
+use lemmy_utils::{error::LemmyError, utils::mention::scrape_text_for_mentions};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use url::Url;
let mentions = scrape_text_for_mentions(&comment.content)
.into_iter()
// Filter only the non-local ones
- .filter(|m| !m.is_local(&context.settings().hostname))
- .collect::<Vec<MentionData>>();
+ .filter(|m| !m.is_local(&context.settings().hostname));
- for mention in &mentions {
+ for mention in mentions {
let identifier = format!("{}@{}", mention.name, mention.domain);
let person = webfinger_resolve_actor::<LemmyContext, ApubPerson>(&identifier, context).await;
if let Ok(person) = person {
// left join comment c2 on c2.path <@ c.path and c2.path != c.path
// group by c.id
- let path_split = parent_path.0.split('.').collect::<Vec<&str>>();
- let parent_id = path_split.get(1);
+ let parent_id = parent_path.0.split('.').nth(1);
if let Some(parent_id) = parent_id {
let top_parent = format!("0.{}", parent_id);
-D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls \
-D clippy::unused_self \
-A clippy::uninlined_format_args \
- -D clippy::get_first
+ -D clippy::get_first \
+ -D clippy::explicit_into_iter_loop \
+ -D clippy::explicit_iter_loop \
+ -D clippy::needless_collect
cargo clippy --workspace --features console -- \
-D clippy::unwrap_used \