1
Fork 0

Prefer iterator to vec

This commit is contained in:
varkor 2018-02-25 00:31:26 +00:00
parent e9e3d5703b
commit e5825c29c3
21 changed files with 55 additions and 64 deletions

View file

@ -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

View file

@ -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