cleanup: move output_options into decrypt arms instead of cloning
The two decrypt match arms (range decrypt and full decrypt) are mutually exclusive, so each can take ownership of output_options; the clone() calls falsely suggested the value is used again later. The encrypt path already moved it. No behavior change beyond dropping one Option<PathBuf> clone per decrypt invocation.
This commit is contained in:
+2
-2
@@ -259,7 +259,7 @@ fn run(mut cli: Cli) -> Result<(), FcryError> {
|
|||||||
offset: o,
|
offset: o,
|
||||||
length: l,
|
length: l,
|
||||||
max_argon_memory_mib: argon_cap.effective_mib,
|
max_argon_memory_mib: argon_cap.effective_mib,
|
||||||
output: output_options.clone(),
|
output: output_options,
|
||||||
};
|
};
|
||||||
decrypt_range(&options, raw_key.as_ref(), pw.as_ref())?;
|
decrypt_range(&options, raw_key.as_ref(), pw.as_ref())?;
|
||||||
}
|
}
|
||||||
@@ -269,7 +269,7 @@ fn run(mut cli: Cli) -> Result<(), FcryError> {
|
|||||||
output_file: output.as_deref().map(PathBuf::from),
|
output_file: output.as_deref().map(PathBuf::from),
|
||||||
threads,
|
threads,
|
||||||
max_argon_memory_mib: argon_cap.effective_mib,
|
max_argon_memory_mib: argon_cap.effective_mib,
|
||||||
output: output_options.clone(),
|
output: output_options,
|
||||||
};
|
};
|
||||||
decrypt(&options, raw_key.as_ref(), pw.as_ref())?;
|
decrypt(&options, raw_key.as_ref(), pw.as_ref())?;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user