Prefer iterator to vec
This commit is contained in:
parent
e9e3d5703b
commit
e5825c29c3
21 changed files with 55 additions and 64 deletions
|
@ -226,7 +226,6 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
|
|||
fn generics_to_path_params(&self, generics: ty::Generics) -> hir::PathParameters {
|
||||
let lifetimes = HirVec::from_vec(
|
||||
generics.lifetimes()
|
||||
.iter()
|
||||
.map(|p| {
|
||||
let name = if p.name == "" {
|
||||
hir::LifetimeName::Static
|
||||
|
|
|
@ -1800,7 +1800,7 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics,
|
|||
// Bounds in the type_params and lifetimes fields are repeated in the
|
||||
// predicates field (see rustc_typeck::collect::ty_generics), so remove
|
||||
// them.
|
||||
let stripped_typarams = gens.types().iter().filter_map(|tp| {
|
||||
let stripped_typarams = gens.types().filter_map(|tp| {
|
||||
if tp.name == keywords::SelfType.name().as_str() {
|
||||
assert_eq!(tp.index, 0);
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue