clippy: shorten assignments
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
1e0c6194b5
commit
a3775bb4e8
@ -605,7 +605,7 @@ pub fn catalog_encode_i64<W: Write>(writer: &mut W, v: i64) -> Result<(), Error>
|
||||
break;
|
||||
}
|
||||
enc.push((128 | (d & 127)) as u8);
|
||||
d = d >> 7;
|
||||
d >>= 7;
|
||||
}
|
||||
writer.write_all(&enc)?;
|
||||
|
||||
@ -659,7 +659,7 @@ pub fn catalog_encode_u64<W: Write>(writer: &mut W, v: u64) -> Result<(), Error>
|
||||
break;
|
||||
}
|
||||
enc.push((128 | (d & 127)) as u8);
|
||||
d = d >> 7;
|
||||
d >>= 7;
|
||||
}
|
||||
writer.write_all(&enc)?;
|
||||
|
||||
|
@ -105,8 +105,8 @@ fn decode_volume_statistics(data: &[u8]) -> Result<Lp17VolumeStatistics, Error>
|
||||
let mut value: u64 = 0;
|
||||
|
||||
for i in 0..len {
|
||||
value = value << 8;
|
||||
value = value | buffer[i] as u64;
|
||||
value <<= 8;
|
||||
value |= buffer[i] as u64;
|
||||
}
|
||||
|
||||
Ok(value)
|
||||
|
@ -77,7 +77,7 @@ impl <W: Write> BlockedWriter<W> {
|
||||
self.bytes_written += BlockHeader::SIZE;
|
||||
|
||||
} else {
|
||||
self.buffer_pos = self.buffer_pos + bytes;
|
||||
self.buffer_pos += bytes;
|
||||
}
|
||||
|
||||
Ok(bytes)
|
||||
|
@ -120,7 +120,7 @@ fn parse_weekdays_range(i: &str) -> IResult<&str, WeekDays> {
|
||||
loop {
|
||||
res |= pos;
|
||||
if pos >= end { break; }
|
||||
pos = pos << 1;
|
||||
pos <<= 1;
|
||||
}
|
||||
WeekDays::from_bits(res).unwrap()
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user