mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-03 18:50:30 +08:00
Use Into::into instead of a closure in radicle-types
This commit is contained in:
@@ -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())),
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
)?;
|
||||
}
|
||||
|
||||
@@ -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(())
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user