fix: Remove needless casts. Thanks clippy!

pull/24376/head
Carol (Nichols || Goulding) 2022-12-15 16:18:05 -05:00
parent 72aab99951
commit 39acfc4f0d
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
4 changed files with 4 additions and 4 deletions

View File

@ -254,7 +254,7 @@ async fn compact_candidates_with_memory_budget<C, Fut>(
// . already considered all remaining candidates.
// . hit the max number of partitions to compact in parallel
if (!parallel_compacting_candidates.is_empty())
&& ((remaining_budget_bytes <= (compactor.config.memory_budget_bytes / 10) as u64)
&& ((remaining_budget_bytes <= compactor.config.memory_budget_bytes / 10)
|| (candidates.is_empty())
|| (count == num_remaining_candidates)
|| (count as u64 == compactor.config.max_parallel_partitions))

View File

@ -141,7 +141,7 @@ pub fn encode(src: &[f64], dst: &mut Vec<u8>) -> Result<(), Box<dyn Error>> {
if m <= 3 {
// 5 bits fit in current byte
dst[n >> 3] |= (mask >> m) as u8;
n += l as usize;
n += l;
} else {
// not enough bits available in current byte
let written = 8 - m;

View File

@ -53,7 +53,7 @@ mod tests {
#[test]
fn encode_uncompressed() {
let src: Vec<u64> = vec![1000, 0, simple8b::MAX_VALUE as u64, 213123421];
let src: Vec<u64> = vec![1000, 0, simple8b::MAX_VALUE, 213123421];
let mut dst = vec![];
let exp = src.clone();

View File

@ -357,7 +357,7 @@ fn truncate_by_months(t: i64, d: &Duration) -> i64 {
// Determine the total number of months and truncate
// the number of months by the duration amount.
let mut total = (year * 12) as i32 + (month - 1) as i32;
let mut total = (year * 12) + (month - 1) as i32;
let remainder = total % d.months() as i32;
total -= remainder;