Skip to content

Commit 2e9d395

Browse files
author
Gunter Schmidt
committed
fix: clippy warning
1 parent 884edb2 commit 2e9d395

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/cmp.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ pub fn parse_params<I: Iterator<Item = OsString>>(mut opts: Peekable<I>) -> Resu
285285

286286
fn prepare_reader(
287287
path: &OsString,
288-
skip: &Option<u64>,
288+
skip: &Option<IgnInit>,
289289
params: &Params,
290290
) -> Result<Box<dyn BufRead>, String> {
291291
let mut reader: Box<dyn BufRead> = if path == "-" {
@@ -304,6 +304,8 @@ fn prepare_reader(
304304
};
305305

306306
if let Some(skip) = skip {
307+
// cast as u64 must remain, because value of IgnInit data type could be changed.
308+
#[allow(clippy::unnecessary_cast)]
307309
if let Err(e) = io::copy(&mut reader.by_ref().take(*skip as u64), &mut io::sink()) {
308310
return Err(format_failure_to_read_input_file(
309311
&params.executable,

0 commit comments

Comments
 (0)