remove unneeded into_iter calls

This commit is contained in:
David Hewitt 2023-01-27 08:20:03 +00:00
parent 794e19d796
commit 1a4153f718
3 changed files with 1 additions and 4 deletions

View File

@ -9,7 +9,7 @@ fn set_new(b: &mut Bencher<'_>) {
const LEN: usize = 100_000;
// Create Python objects up-front, so that the benchmark doesn't need to include
// the cost of allocating LEN Python integers
let elements: Vec<PyObject> = (0..LEN).into_iter().map(|i| i.into_py(py)).collect();
let elements: Vec<PyObject> = (0..LEN).map(|i| i.into_py(py)).collect();
b.iter(|| {
let pool = unsafe { py.new_pool() };
PySet::new(py, &elements).unwrap();

View File

@ -278,7 +278,6 @@ impl<'a> Container<'a> {
let self_ty = &self.path;
let struct_name = &self.name();
let field_idents: Vec<_> = (0..struct_fields.len())
.into_iter()
.map(|i| format_ident!("arg{}", i))
.collect();
let fields = struct_fields.iter().zip(&field_idents).enumerate().map(|(index, (field, ident))| {

View File

@ -1109,7 +1109,6 @@ impl SlotDef {
let py = syn::Ident::new("_py", Span::call_site());
let arg_types: &Vec<_> = &arguments.iter().map(|arg| arg.ffi_type()).collect();
let arg_idents: &Vec<_> = &(0..arguments.len())
.into_iter()
.map(|i| format_ident!("arg{}", i))
.collect();
let wrapper_ident = format_ident!("__pymethod_{}__", method_name);
@ -1220,7 +1219,6 @@ impl SlotFragmentDef {
let py = syn::Ident::new("_py", Span::call_site());
let arg_types: &Vec<_> = &arguments.iter().map(|arg| arg.ffi_type()).collect();
let arg_idents: &Vec<_> = &(0..arguments.len())
.into_iter()
.map(|i| format_ident!("arg{}", i))
.collect();
let body = generate_method_body(cls, spec, &py, arguments, *extract_error_mode, None)?;