Skip to content

Commit

Permalink
excel: move sheet_vec variable within required scope
Browse files Browse the repository at this point in the history
to eliminate unnecessary clone()
  • Loading branch information
jqnatividad committed Dec 6, 2023
1 parent e2893d1 commit ab6af32
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cmd/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
return fail!("No sheets found.");
}
let num_sheets = sheet_names.len();
#[allow(clippy::redundant_clone)]
let sheet_vec = sheet_names.clone();

let mut wtr = Config::new(&args.flag_output)
.flexible(args.flag_flexible)
Expand Down Expand Up @@ -294,6 +292,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
sheet: vec![],
};
let mut metadata_record;
let sheet_vec = sheet_names;

for (i, sheet_name) in sheet_vec.iter().enumerate() {
let range = if let Some(result) = workbook.worksheet_range_at(i) {
Expand Down

0 comments on commit ab6af32

Please sign in to comment.