[pbs-devel] [PATCH proxmox 01/18] formatting fixup
Wolfgang Bumiller
w.bumiller at proxmox.com
Fri Dec 18 12:25:49 CET 2020
Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
proxmox/src/tools/io/read.rs | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/proxmox/src/tools/io/read.rs b/proxmox/src/tools/io/read.rs
index 9bba54b..eed96b7 100644
--- a/proxmox/src/tools/io/read.rs
+++ b/proxmox/src/tools/io/read.rs
@@ -298,17 +298,21 @@ impl<R: io::Read> ReadExt for R {
loop {
match self.read(&mut buf) {
Ok(0) => {
- if read_bytes == 0 { return Ok(false); }
+ if read_bytes == 0 {
+ return Ok(false);
+ }
return Err(io::Error::new(
io::ErrorKind::UnexpectedEof,
- "failed to fill whole buffer")
- );
+ "failed to fill whole buffer",
+ ));
}
- Ok(n) => {
+ Ok(n) => {
let tmp = buf;
buf = &mut tmp[n..];
read_bytes += n;
- if buf.is_empty() { return Ok(true); }
+ if buf.is_empty() {
+ return Ok(true);
+ }
}
Err(ref e) if e.kind() == std::io::ErrorKind::Interrupted => {}
Err(e) => return Err(e),
@@ -318,7 +322,7 @@ impl<R: io::Read> ReadExt for R {
fn skip_to_end(&mut self) -> io::Result<usize> {
let mut skipped_bytes = 0;
- let mut buf = unsafe { vec::uninitialized(32*1024) };
+ let mut buf = unsafe { vec::uninitialized(32 * 1024) };
loop {
match self.read(&mut buf) {
Ok(0) => return Ok(skipped_bytes),
--
2.20.1
More information about the pbs-devel
mailing list