Use Into::into instead of a closure in radicle-types

This commit is contained in:
Sebastian Martinez
2024-11-22 11:15:05 +01:00
parent c176fb9a3d
commit 4670370562
5 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ impl Revision {
.map(|(emoji, authors)| {
cobs::thread::Reaction::new(
*emoji,
authors.into_iter().map(|a| a.into()).collect::<Vec<_>>(),
authors.into_iter().map(Into::into).collect::<Vec<_>>(),
location
.as_ref()
.map(|l| cobs::thread::CodeLocation::new(l.clone())),
+2 -2
View File
@@ -70,7 +70,7 @@ impl Comment<CodeLocation> {
.map(|(reaction, authors)| {
cobs::thread::Reaction::new(
*reaction,
authors.into_iter().map(|s| s.into()).collect(),
authors.into_iter().map(Into::into).collect(),
None,
aliases,
)
@@ -108,7 +108,7 @@ impl Comment<cobs::Never> {
.map(|(reaction, authors)| {
cobs::thread::Reaction::new(
*reaction,
authors.into_iter().map(|m| m.into()).collect::<Vec<_>>(),
authors.into_iter().map(Into::into).collect::<Vec<_>>(),
None,
aliases,
)
+3 -3
View File
@@ -110,7 +110,7 @@ pub trait IssuesMut: Profile {
new.description,
&new.labels,
&new.assignees,
new.embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
new.embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
@@ -164,7 +164,7 @@ pub trait IssuesMut: Profile {
issue.comment(
body,
reply_to.unwrap_or(cob_id),
embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
}
@@ -172,7 +172,7 @@ pub trait IssuesMut: Profile {
issue.edit_comment(
id,
body,
embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
}
+6 -6
View File
@@ -129,7 +129,7 @@ pub trait PatchesMut: Profile {
patch.edit_revision(
revision,
description,
embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
}
@@ -187,7 +187,7 @@ pub trait PatchesMut: Profile {
body,
location.map(|l| l.into()),
reply_to,
embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
}
@@ -201,7 +201,7 @@ pub trait PatchesMut: Profile {
review,
comment,
body,
embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
}
@@ -240,7 +240,7 @@ pub trait PatchesMut: Profile {
body,
reply_to,
location.map(|l| l.into()),
embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
}
@@ -254,7 +254,7 @@ pub trait PatchesMut: Profile {
revision,
comment,
body,
embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
}
@@ -409,7 +409,7 @@ pub trait PatchesMut: Profile {
new.body,
new.location.map(|l| l.into()),
new.reply_to,
new.embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
new.embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
)?;
Ok(())
+4 -4
View File
@@ -57,7 +57,7 @@ pub trait Thread: Profile {
let oid = issue.comment(
n.body,
id,
n.embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
n.embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
@@ -72,7 +72,7 @@ pub trait Thread: Profile {
new.body,
id.into(),
None,
new.embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
new.embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
LocalTime::now().into(),
),
aliases,
@@ -98,7 +98,7 @@ pub trait Thread: Profile {
n.body,
n.reply_to,
n.location.map(|l| l.into()),
n.embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
n.embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
&signer,
)?;
@@ -113,7 +113,7 @@ pub trait Thread: Profile {
new.body,
new.reply_to,
new.location.map(|l| l.into()),
new.embeds.into_iter().map(|e| e.into()).collect::<Vec<_>>(),
new.embeds.into_iter().map(Into::into).collect::<Vec<_>>(),
LocalTime::now().into(),
),
aliases,