chore(primitives): use derive_more where possible (#8834)

This commit is contained in:
Alexey Shekhirin
2024-06-14 15:06:03 +01:00
committed by GitHub
parent 3af5bd857e
commit ca574edbc8
9 changed files with 58 additions and 208 deletions

View File

@@ -1,25 +1,18 @@
use bytes::BufMut;
use derive_more::Deref;
use roaring::RoaringTreemap;
use serde::{
de::{SeqAccess, Unexpected, Visitor},
ser::SerializeSeq,
Deserialize, Deserializer, Serialize, Serializer,
};
use std::{fmt, ops::Deref};
use std::fmt;
/// Uses Roaring Bitmaps to hold a list of integers. It provides really good compression with the
/// capability to access its elements without decoding it.
#[derive(Clone, PartialEq, Default)]
#[derive(Clone, PartialEq, Default, Deref)]
pub struct IntegerList(pub RoaringTreemap);
impl Deref for IntegerList {
type Target = RoaringTreemap;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl fmt::Debug for IntegerList {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let vec: Vec<u64> = self.0.iter().collect();