refactor(lint): use a let binding to create a longer lived value

This commit is contained in:
Orhun Parmaksız 2022-08-04 02:36:21 +02:00
parent 94d369cf82
commit 1e02314070
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -172,7 +172,8 @@ impl<'a, Output: Write> App<'a, Output> {
/// Processes the parameters in the given file.
pub fn preload_from_file(&mut self, path: PathBuf) -> Result<()> {
if path == PathBuf::from("-") {
let lines = io::stdin().lock().lines();
let stdin = io::stdin();
let lines = stdin.lock().lines();
for line in lines {
if let Err(e) = self.process_parameter(line?, true, false) {
println!("{}: {}", env!("CARGO_PKG_NAME"), e);