Skip to content

Commit 2d5a226

Browse files
committed
cleanup: unnecessary clone during lower generics args
1 parent b9be3c4 commit 2d5a226

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+2
-2
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ pub fn lower_generic_args<'tcx: 'a, 'a>(
228228
// Check whether this segment takes generic arguments and the user has provided any.
229229
let (generic_args, infer_args) = ctx.args_for_def_id(def_id);
230230

231-
let args_iter = generic_args.iter().flat_map(|generic_args| generic_args.args.iter());
232-
let mut args_iter = args_iter.clone().peekable();
231+
let mut args_iter =
232+
generic_args.iter().flat_map(|generic_args| generic_args.args.iter()).peekable();
233233

234234
// If we encounter a type or const when we expect a lifetime, we infer the lifetimes.
235235
// If we later encounter a lifetime, we know that the arguments were provided in the

0 commit comments

Comments
 (0)