You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follows #468
## Synopsis
In #468, the `FromStr` derive was reworked. However, the check for
inferring trait bounds for the inner type was simplified to
`!generics.params.is_empty()`, which is not a very correct assumption,
because applies the redundant bounds for cases like these:
```rust
#[derive(FromStr)]
struct Int<const N: usize>(i32);
```
```rust
impl<const N: usize> derive_more::core::str::FromStr for Int<N>
where
i32: derive_more::core::str::FromStr
{ /* ... */}
```
## Solution
Use `utils::GenericSearch` machinery as a common mechanism for this
purpose.
## Additionally
Refactored `utils::GenericSearch` to use `Vec` instead `HashSet`,
because in the majority of cases there won't be any duplicates in
generic parameters and their number won't be big enough for a `HashSet`
to make a positive performance benefit. At the same moment, `HashSet`
requires `Hash` implementation of `syn::Ident` which is gated by the
`syn/extra-traits` feature, and thus we can lift it requirement for
`utils::GenericSearch` usage.
0 commit comments