Skip to content

Commit f9d928f

Browse files
committed
Clippy: Fix needless_collect
1 parent 3fb127b commit f9d928f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

onnxruntime/src/session.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -380,24 +380,18 @@ impl<'a> Session<'a> {
380380

381381
// Build arguments to Run()
382382

383-
let input_names: Vec<String> = self.inputs.iter().map(|input| input.name.clone()).collect();
384-
let input_names_cstring: Vec<CString> = input_names
383+
let input_names_ptr: Vec<*const i8> = self
384+
.inputs
385385
.iter()
386-
.cloned()
386+
.map(|input| input.name.clone())
387387
.map(|n| CString::new(n).unwrap())
388-
.collect();
389-
let input_names_ptr: Vec<*const i8> = input_names_cstring
390-
.into_iter()
391388
.map(|n| n.into_raw() as *const i8)
392389
.collect();
393390

394-
let output_names: Vec<String> = self
391+
let output_names_cstring: Vec<CString> = self
395392
.outputs
396393
.iter()
397394
.map(|output| output.name.clone())
398-
.collect();
399-
let output_names_cstring: Vec<CString> = output_names
400-
.into_iter()
401395
.map(|n| CString::new(n).unwrap())
402396
.collect();
403397
let output_names_ptr: Vec<*const i8> = output_names_cstring

0 commit comments

Comments
 (0)