mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
enable needless_pass_by_value lint
This commit is contained in:
parent
c4a9bca16f
commit
a636405bed
3 changed files with 10 additions and 9 deletions
|
|
@ -55,6 +55,7 @@ missing_assert_message = "warn"
|
|||
mod_module_files = "warn"
|
||||
multiple_inherent_impl = "warn"
|
||||
mutex_atomic = "warn"
|
||||
needless_pass_by_value = "warn"
|
||||
negative_feature_names = "warn"
|
||||
pub_without_shorthand = "warn"
|
||||
rc_buffer = "warn"
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ pub(crate) async fn get_relating_events_with_rel_type_and_event_type_route(
|
|||
sender_user,
|
||||
&body.room_id,
|
||||
&body.event_id,
|
||||
Some(body.event_type.clone()),
|
||||
Some(body.rel_type.clone()),
|
||||
Some(&body.event_type),
|
||||
Some(&body.rel_type),
|
||||
from,
|
||||
to,
|
||||
limit,
|
||||
|
|
@ -95,7 +95,7 @@ pub(crate) async fn get_relating_events_with_rel_type_route(
|
|||
&body.room_id,
|
||||
&body.event_id,
|
||||
None,
|
||||
Some(body.rel_type.clone()),
|
||||
Some(&body.rel_type),
|
||||
from,
|
||||
to,
|
||||
limit,
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ impl Service {
|
|||
sender_user: &UserId,
|
||||
room_id: &RoomId,
|
||||
target: &EventId,
|
||||
filter_event_type: Option<TimelineEventType>,
|
||||
filter_rel_type: Option<RelationType>,
|
||||
filter_event_type: Option<&TimelineEventType>,
|
||||
filter_rel_type: Option<&RelationType>,
|
||||
from: PduCount,
|
||||
to: Option<PduCount>,
|
||||
limit: usize,
|
||||
|
|
@ -63,7 +63,7 @@ impl Service {
|
|||
.relations_until(sender_user, room_id, target, from)? // TODO: should be relations_after
|
||||
.filter(|r| {
|
||||
r.as_ref().map_or(true, |(_, pdu)| {
|
||||
filter_event_type.as_ref().map_or(true, |t| &pdu.kind == t)
|
||||
filter_event_type.as_ref().map_or(true, |t| &&pdu.kind == t)
|
||||
&& if let Ok(content) =
|
||||
serde_json::from_str::<ExtractRelatesToEventId>(
|
||||
pdu.content.get(),
|
||||
|
|
@ -71,7 +71,7 @@ impl Service {
|
|||
{
|
||||
filter_rel_type
|
||||
.as_ref()
|
||||
.map_or(true, |r| &content.relates_to.rel_type == r)
|
||||
.map_or(true, |r| &&content.relates_to.rel_type == r)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ impl Service {
|
|||
.relations_until(sender_user, room_id, target, from)?
|
||||
.filter(|r| {
|
||||
r.as_ref().map_or(true, |(_, pdu)| {
|
||||
filter_event_type.as_ref().map_or(true, |t| &pdu.kind == t)
|
||||
filter_event_type.as_ref().map_or(true, |t| &&pdu.kind == t)
|
||||
&& if let Ok(content) =
|
||||
serde_json::from_str::<ExtractRelatesToEventId>(
|
||||
pdu.content.get(),
|
||||
|
|
@ -118,7 +118,7 @@ impl Service {
|
|||
{
|
||||
filter_rel_type
|
||||
.as_ref()
|
||||
.map_or(true, |r| &content.relates_to.rel_type == r)
|
||||
.map_or(true, |r| &&content.relates_to.rel_type == r)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue