From 8a7f3425d8b51dc5079cc84b8464cc62523b3b04 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 9 Aug 2022 15:29:51 +0000 Subject: [PATCH] qcow: fix two clippy warnings Signed-off-by: Wei Liu --- qcow/src/qcow.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/qcow/src/qcow.rs b/qcow/src/qcow.rs index ecbb49edb..7b9804ea6 100644 --- a/qcow/src/qcow.rs +++ b/qcow/src/qcow.rs @@ -1487,16 +1487,11 @@ impl Write for QcowFile { let offset = self.file_offset_write(curr_addr)?; let count = self.limit_range_cluster(curr_addr, write_count - nwritten); - if let Err(e) = self.raw_file.file_mut().seek(SeekFrom::Start(offset)) { - return Err(e); - } - if let Err(e) = self + self.raw_file.file_mut().seek(SeekFrom::Start(offset))?; + let count = self .raw_file .file_mut() - .write(&buf[nwritten..(nwritten + count)]) - { - return Err(e); - } + .write(&buf[nwritten..(nwritten + count)])?; nwritten += count; }