Skip to content

Commit 9de4b7f

Browse files
committed
simplify dependent bounds for generics
1 parent f81673c commit 9de4b7f

8 files changed

Lines changed: 14 additions & 14 deletions

File tree

crates/cli/src/service/bugzilla/update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct CommentPrivacy<T: FromStr + PartialOrd + Eq + Hash> {
2828

2929
impl<T: FromStr + PartialOrd + Eq + Hash> FromStr for CommentPrivacy<T>
3030
where
31-
<T as FromStr>::Err: fmt::Display + fmt::Debug,
31+
T::Err: fmt::Display + fmt::Debug,
3232
{
3333
type Err = anyhow::Error;
3434

crates/lib/src/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl<T: fmt::Display + FromStr> CsvOrStdin<T> {
3838
impl<T> FromStr for CsvOrStdin<T>
3939
where
4040
T: fmt::Display + FromStr,
41-
<T as FromStr>::Err: fmt::Display,
41+
T::Err: fmt::Display,
4242
{
4343
type Err = Error;
4444

crates/lib/src/args/csv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<T: fmt::Display + FromStr> Csv<T> {
2121
impl<T> FromStr for Csv<T>
2222
where
2323
T: fmt::Display + FromStr,
24-
<T as FromStr>::Err: fmt::Display,
24+
T::Err: fmt::Display,
2525
{
2626
type Err = Error;
2727

crates/lib/src/args/exists.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<T> ExistsOrValues<MaybeStdinVec<T>> {
2626
impl<T> FromStr for ExistsOrValues<T>
2727
where
2828
T: FromStr,
29-
<T as FromStr>::Err: fmt::Display,
29+
T::Err: fmt::Display,
3030
{
3131
type Err = Error;
3232

crates/lib/src/args/maybe_stdin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub struct MaybeStdin<T> {
8383
impl<T> FromStr for MaybeStdin<T>
8484
where
8585
T: FromStr,
86-
<T as FromStr>::Err: fmt::Display,
86+
T::Err: fmt::Display,
8787
{
8888
type Err = StdinError;
8989

@@ -150,7 +150,7 @@ pub struct MaybeStdinVec<T> {
150150
impl<T> FromStr for MaybeStdinVec<T>
151151
where
152152
T: FromStr,
153-
<T as FromStr>::Err: fmt::Display,
153+
T::Err: fmt::Display,
154154
{
155155
type Err = StdinError;
156156

crates/lib/src/objects.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub enum RangeOrValue<T: Eq> {
6868
impl<T> FromStr for RangeOrValue<T>
6969
where
7070
T: FromStr + Eq,
71-
<T as FromStr>::Err: std::fmt::Display + std::fmt::Debug,
71+
T::Err: std::fmt::Display + std::fmt::Debug,
7272
{
7373
type Err = Error;
7474

@@ -159,7 +159,7 @@ pub enum RangeOp<T: Eq> {
159159
impl<T> FromStr for RangeOp<T>
160160
where
161161
T: FromStr + Eq,
162-
<T as FromStr>::Err: std::fmt::Display + std::fmt::Debug,
162+
T::Err: std::fmt::Display + std::fmt::Debug,
163163
{
164164
type Err = Error;
165165

@@ -211,7 +211,7 @@ pub enum Range<T: Eq> {
211211
impl<T> FromStr for Range<T>
212212
where
213213
T: FromStr + Eq,
214-
<T as FromStr>::Err: std::fmt::Display + std::fmt::Debug,
214+
T::Err: std::fmt::Display + std::fmt::Debug,
215215
{
216216
type Err = Error;
217217

crates/lib/src/output.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ fn truncate(data: &str, width: usize) -> Cow<'_, str> {
8181
}
8282

8383
/// Output an iterable field in truncated list format.
84-
fn truncated_list<W, I, S>(f: &mut W, name: &str, data: I, width: usize) -> io::Result<()>
84+
fn truncated_list<W, I>(f: &mut W, name: &str, data: I, width: usize) -> io::Result<()>
8585
where
8686
W: Write,
87-
I: IntoIterator<Item = S>,
88-
<I as IntoIterator>::IntoIter: ExactSizeIterator,
89-
S: std::fmt::Display,
87+
I: IntoIterator,
88+
I::IntoIter: ExactSizeIterator,
89+
I::Item: std::fmt::Display,
9090
{
9191
let mut values = data.into_iter();
9292
match values.len().cmp(&1) {

crates/lib/src/service/bugzilla/update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub enum RangeOrSet<T: FromStr + PartialOrd + Eq + Hash> {
7777

7878
impl<T: FromStr + PartialOrd + Eq + Hash> FromStr for RangeOrSet<T>
7979
where
80-
<T as FromStr>::Err: fmt::Display + fmt::Debug,
80+
T::Err: fmt::Display + fmt::Debug,
8181
{
8282
type Err = crate::Error;
8383

0 commit comments

Comments
 (0)