Skip to content

Commit b45efcd

Browse files
committed
rework(lib): drop unnecessary generics for Iterator item types
1 parent 5cc5806 commit b45efcd

15 files changed

Lines changed: 105 additions & 105 deletions

File tree

‎crates/cli/src/utils.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ where
4242
confirm_inner(prompt, default, io::stdin().lock(), io::stderr().lock())
4343
}
4444

45-
pub(crate) fn launch_browser<I, S>(urls: I) -> Result<()>
45+
pub(crate) fn launch_browser<I>(urls: I) -> Result<()>
4646
where
47-
I: IntoIterator<Item = S>,
48-
S: AsRef<str>,
47+
I: IntoIterator,
48+
I::Item: AsRef<str>,
4949
{
5050
let browser = env::var("BROWSER").unwrap_or_default();
5151
let mut args = shlex::split(&browser)

‎crates/lib/src/output.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ where
9898
}
9999

100100
/// Output an iterable field in wrapped CSV format.
101-
pub(crate) fn wrapped_csv<I, W, S>(f: &mut W, name: &str, data: I, width: usize) -> io::Result<()>
101+
pub(crate) fn wrapped_csv<I, W>(f: &mut W, name: &str, data: I, width: usize) -> io::Result<()>
102102
where
103-
I: IntoIterator<Item = S>,
103+
I: IntoIterator,
104+
I::Item: std::fmt::Display,
104105
W: Write,
105-
S: std::fmt::Display,
106106
{
107107
let rendered = data.into_iter().join(", ");
108108
if !rendered.is_empty() {

‎crates/lib/src/service/bugzilla/requests/attachment/create.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,10 @@ pub struct Request {
361361

362362
impl Request {
363363
/// Create a new request.
364-
pub(crate) fn new<I, S>(service: Bugzilla, ids: I) -> Self
364+
pub(crate) fn new<I>(service: Bugzilla, ids: I) -> Self
365365
where
366-
I: IntoIterator<Item = S>,
367-
S: fmt::Display,
366+
I: IntoIterator,
367+
I::Item: fmt::Display,
368368
{
369369
Self {
370370
service,

‎crates/lib/src/service/bugzilla/requests/attachment/get_item.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ pub struct Request {
2323

2424
impl Request {
2525
/// Create a new request.
26-
pub(crate) fn new<I, S>(service: Bugzilla, ids: I) -> Self
26+
pub(crate) fn new<I>(service: Bugzilla, ids: I) -> Self
2727
where
28-
I: IntoIterator<Item = S>,
29-
S: std::fmt::Display,
28+
I: IntoIterator,
29+
I::Item: std::fmt::Display,
3030
{
3131
Self {
3232
service,

‎crates/lib/src/service/bugzilla/requests/comment/get.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub struct Request {
1616
}
1717

1818
impl Request {
19-
pub(crate) fn new<I, S>(service: Bugzilla, ids: I) -> Self
19+
pub(crate) fn new<I>(service: Bugzilla, ids: I) -> Self
2020
where
21-
I: IntoIterator<Item = S>,
22-
S: std::fmt::Display,
21+
I: IntoIterator,
22+
I::Item: std::fmt::Display,
2323
{
2424
Self {
2525
service,

‎crates/lib/src/service/bugzilla/requests/comment/tag.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ pub struct Request {
2020
}
2121

2222
impl Request {
23-
pub(crate) fn new<I, S>(service: Bugzilla, ids: I) -> Self
23+
pub(crate) fn new<I>(service: Bugzilla, ids: I) -> Self
2424
where
25-
I: IntoIterator<Item = S>,
26-
S: std::fmt::Display,
25+
I: IntoIterator,
26+
I::Item: std::fmt::Display,
2727
{
2828
Self {
2929
service,

‎crates/lib/src/service/bugzilla/requests/create.rs‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ impl Request {
136136
Ok(params)
137137
}
138138

139-
pub fn alias<I, S>(&mut self, value: I) -> &mut Self
139+
pub fn alias<I>(&mut self, value: I) -> &mut Self
140140
where
141-
I: IntoIterator<Item = S>,
142-
S: fmt::Display,
141+
I: IntoIterator,
142+
I::Item: fmt::Display,
143143
{
144144
self.params.alias = Some(value.into_iter().map(|x| x.to_string()).collect());
145145
self
@@ -153,19 +153,19 @@ impl Request {
153153
self
154154
}
155155

156-
pub fn blocks<I, S>(&mut self, value: I) -> &mut Self
156+
pub fn blocks<I>(&mut self, value: I) -> &mut Self
157157
where
158-
I: IntoIterator<Item = S>,
159-
S: fmt::Display,
158+
I: IntoIterator,
159+
I::Item: fmt::Display,
160160
{
161161
self.params.blocks = Some(value.into_iter().map(|x| x.to_string()).collect());
162162
self
163163
}
164164

165-
pub fn cc<I, S>(&mut self, value: I) -> &mut Self
165+
pub fn cc<I>(&mut self, value: I) -> &mut Self
166166
where
167-
I: IntoIterator<Item = S>,
168-
S: fmt::Display,
167+
I: IntoIterator,
168+
I::Item: fmt::Display,
169169
{
170170
self.params.cc = Some(value.into_iter().map(|x| x.to_string()).collect());
171171
self
@@ -179,10 +179,10 @@ impl Request {
179179
self
180180
}
181181

182-
pub fn depends<I, S>(&mut self, value: I) -> &mut Self
182+
pub fn depends<I>(&mut self, value: I) -> &mut Self
183183
where
184-
I: IntoIterator<Item = S>,
185-
S: fmt::Display,
184+
I: IntoIterator,
185+
I::Item: fmt::Display,
186186
{
187187
self.params.depends = Some(value.into_iter().map(|x| x.to_string()).collect());
188188
self
@@ -204,19 +204,19 @@ impl Request {
204204
self
205205
}
206206

207-
pub fn groups<I, S>(&mut self, value: I) -> &mut Self
207+
pub fn groups<I>(&mut self, value: I) -> &mut Self
208208
where
209-
I: IntoIterator<Item = S>,
210-
S: fmt::Display,
209+
I: IntoIterator,
210+
I::Item: fmt::Display,
211211
{
212212
self.params.groups = Some(value.into_iter().map(|x| x.to_string()).collect());
213213
self
214214
}
215215

216-
pub fn keywords<I, S>(&mut self, value: I) -> &mut Self
216+
pub fn keywords<I>(&mut self, value: I) -> &mut Self
217217
where
218-
I: IntoIterator<Item = S>,
219-
S: fmt::Display,
218+
I: IntoIterator,
219+
I::Item: fmt::Display,
220220
{
221221
self.params.keywords = Some(value.into_iter().map(|x| x.to_string()).collect());
222222
self
@@ -270,10 +270,10 @@ impl Request {
270270
self
271271
}
272272

273-
pub fn see_also<I, S>(&mut self, value: I) -> &mut Self
273+
pub fn see_also<I>(&mut self, value: I) -> &mut Self
274274
where
275-
I: IntoIterator<Item = S>,
276-
S: fmt::Display,
275+
I: IntoIterator,
276+
I::Item: fmt::Display,
277277
{
278278
self.params.see_also = Some(value.into_iter().map(|x| x.to_string()).collect());
279279
self

‎crates/lib/src/service/bugzilla/requests/get.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ pub struct Request {
1818
}
1919

2020
impl Request {
21-
pub(crate) fn new<I, S>(service: Bugzilla, ids: I) -> Self
21+
pub(crate) fn new<I>(service: Bugzilla, ids: I) -> Self
2222
where
23-
I: IntoIterator<Item = S>,
24-
S: std::fmt::Display,
23+
I: IntoIterator,
24+
I::Item: std::fmt::Display,
2525
{
2626
Self {
2727
service,

‎crates/lib/src/service/bugzilla/requests/history.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ pub struct Request {
1515
}
1616

1717
impl Request {
18-
pub(crate) fn new<I, S>(service: Bugzilla, ids: I) -> Self
18+
pub(crate) fn new<I>(service: Bugzilla, ids: I) -> Self
1919
where
20-
I: IntoIterator<Item = S>,
21-
S: std::fmt::Display,
20+
I: IntoIterator,
21+
I::Item: std::fmt::Display,
2222
{
2323
Self {
2424
service,

‎crates/lib/src/service/bugzilla/requests/search.rs‎

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,10 @@ impl Request {
648648
self
649649
}
650650

651-
pub fn changed<I, S>(&mut self, values: I) -> &mut Self
651+
pub fn changed<I>(&mut self, values: I) -> &mut Self
652652
where
653-
I: IntoIterator<Item = S>,
654-
S: fmt::Display,
653+
I: IntoIterator,
654+
I::Item: fmt::Display,
655655
{
656656
self.params.changed = Some(
657657
values
@@ -679,11 +679,11 @@ impl Request {
679679
self
680680
}
681681

682-
pub fn changed_by<F, I, S>(&mut self, field: F, users: I) -> &mut Self
682+
pub fn changed_by<F, I>(&mut self, field: F, users: I) -> &mut Self
683683
where
684684
F: fmt::Display,
685-
I: IntoIterator<Item = S>,
686-
S: fmt::Display,
685+
I: IntoIterator,
686+
I::Item: fmt::Display,
687687
{
688688
let users = users.into_iter().map(|x| x.to_string()).collect();
689689
self.params
@@ -726,10 +726,10 @@ impl Request {
726726
self
727727
}
728728

729-
pub fn assignee<I, T>(&mut self, values: I) -> &mut Self
729+
pub fn assignee<I>(&mut self, values: I) -> &mut Self
730730
where
731-
I: IntoIterator<Item = T>,
732-
T: Into<Match>,
731+
I: IntoIterator,
732+
I::Item: Into<Match>,
733733
{
734734
self.params
735735
.assignee
@@ -738,10 +738,10 @@ impl Request {
738738
self
739739
}
740740

741-
pub fn commenter<I, T>(&mut self, values: I) -> &mut Self
741+
pub fn commenter<I>(&mut self, values: I) -> &mut Self
742742
where
743-
I: IntoIterator<Item = T>,
744-
T: Into<Match>,
743+
I: IntoIterator,
744+
I::Item: Into<Match>,
745745
{
746746
self.params
747747
.commenter
@@ -758,10 +758,10 @@ impl Request {
758758
self
759759
}
760760

761-
pub fn flagger<I, T>(&mut self, values: I) -> &mut Self
761+
pub fn flagger<I>(&mut self, values: I) -> &mut Self
762762
where
763-
I: IntoIterator<Item = T>,
764-
T: Into<Match>,
763+
I: IntoIterator,
764+
I::Item: Into<Match>,
765765
{
766766
self.params
767767
.flagger
@@ -778,10 +778,10 @@ impl Request {
778778
self
779779
}
780780

781-
pub fn reporter<I, T>(&mut self, values: I) -> &mut Self
781+
pub fn reporter<I>(&mut self, values: I) -> &mut Self
782782
where
783-
I: IntoIterator<Item = T>,
784-
T: Into<Match>,
783+
I: IntoIterator,
784+
I::Item: Into<Match>,
785785
{
786786
self.params
787787
.reporter
@@ -798,28 +798,28 @@ impl Request {
798798
self
799799
}
800800

801-
pub fn fields<I, F>(&mut self, values: I) -> &mut Self
801+
pub fn fields<I>(&mut self, values: I) -> &mut Self
802802
where
803-
I: IntoIterator<Item = F>,
804-
F: Into<FilterField>,
803+
I: IntoIterator,
804+
I::Item: Into<FilterField>,
805805
{
806806
self.params.fields = Some(values.into_iter().map(Into::into).collect());
807807
self
808808
}
809809

810-
pub fn status<I, S>(&mut self, values: I) -> &mut Self
810+
pub fn status<I>(&mut self, values: I) -> &mut Self
811811
where
812-
I: IntoIterator<Item = S>,
813-
S: Into<String>,
812+
I: IntoIterator,
813+
I::Item: Into<String>,
814814
{
815815
self.params.status = Some(values.into_iter().map(Into::into).collect());
816816
self
817817
}
818818

819-
pub fn summary<I, S>(&mut self, values: I) -> &mut Self
819+
pub fn summary<I>(&mut self, values: I) -> &mut Self
820820
where
821-
I: IntoIterator<Item = S>,
822-
S: Into<Match>,
821+
I: IntoIterator,
822+
I::Item: Into<Match>,
823823
{
824824
self.params.summary = Some(values.into_iter().map(Into::into).collect());
825825
self
@@ -855,10 +855,10 @@ impl Request {
855855
self
856856
}
857857

858-
pub fn priority<I, T>(&mut self, values: I) -> &mut Self
858+
pub fn priority<I>(&mut self, values: I) -> &mut Self
859859
where
860-
I: IntoIterator<Item = T>,
861-
T: Into<Match>,
860+
I: IntoIterator,
861+
I::Item: Into<Match>,
862862
{
863863
self.params
864864
.priority
@@ -867,10 +867,10 @@ impl Request {
867867
self
868868
}
869869

870-
pub fn severity<I, T>(&mut self, values: I) -> &mut Self
870+
pub fn severity<I>(&mut self, values: I) -> &mut Self
871871
where
872-
I: IntoIterator<Item = T>,
873-
T: Into<Match>,
872+
I: IntoIterator,
873+
I::Item: Into<Match>,
874874
{
875875
self.params
876876
.severity
@@ -1635,11 +1635,11 @@ impl QueryBuilder<'_> {
16351635
Ok(())
16361636
}
16371637

1638-
fn changed_by<F, I, S>(&mut self, field: F, users: I) -> crate::Result<()>
1638+
fn changed_by<F, I>(&mut self, field: F, users: I) -> crate::Result<()>
16391639
where
16401640
F: AsRef<str>,
1641-
I: IntoIterator<Item = S>,
1642-
S: AsRef<str>,
1641+
I: IntoIterator,
1642+
I::Item: AsRef<str>,
16431643
{
16441644
let field = ChangeField::from_str(field.as_ref())?;
16451645
for user in users {
@@ -1813,10 +1813,10 @@ impl QueryBuilder<'_> {
18131813
self.advanced_field("cc", value.op(), value);
18141814
}
18151815

1816-
fn fields<I, F>(&mut self, fields: I)
1816+
fn fields<I>(&mut self, fields: I)
18171817
where
1818-
I: IntoIterator<Item = F>,
1819-
F: Into<FilterField>,
1818+
I: IntoIterator,
1819+
I::Item: Into<FilterField>,
18201820
{
18211821
let mut fields: IndexSet<_> = fields.into_iter().map(Into::into).collect();
18221822

0 commit comments

Comments
 (0)