Skip to content

Commit

Permalink
Merge pull request #1604 from quickwit-oss/replace_cbor
Browse files Browse the repository at this point in the history
replace cbor with cborium
  • Loading branch information
PSeitz authored Oct 7, 2022
2 parents c2f1c25 + 516e609 commit 5f565e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ lru = "0.7.5"
fastdivide = "0.4.0"
itertools = "0.10.3"
measure_time = "0.8.2"
serde_cbor = { version = "0.11.2", optional = true }
ciborium = { version = "0.2", optional = true}
async-trait = "0.1.53"
arc-swap = "1.5.0"

Expand Down Expand Up @@ -101,7 +101,7 @@ zstd-compression = ["zstd"]
failpoints = ["fail/failpoints"]
unstable = [] # useful for benches.

quickwit = ["serde_cbor"]
quickwit = ["ciborium"]

[workspace]
members = ["query-grammar", "bitpacker", "common", "fastfield_codecs", "ownedbytes"]
Expand Down
8 changes: 4 additions & 4 deletions src/termdict/sstable_termdict/sstable/sstable_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct SSTableIndex {

impl SSTableIndex {
pub(crate) fn load(data: &[u8]) -> Result<SSTableIndex, DataCorruption> {
serde_cbor::de::from_slice(data)
ciborium::de::from_reader(data)
.map_err(|_| DataCorruption::comment_only("SSTable index is corrupted"))
}

Expand Down Expand Up @@ -85,9 +85,9 @@ impl SSTableIndexBuilder {
})
}

pub fn serialize(&self, wrt: &mut dyn io::Write) -> io::Result<()> {
serde_cbor::ser::to_writer(wrt, &self.index).unwrap();
Ok(())
pub fn serialize<W: std::io::Write>(&self, wrt: W) -> io::Result<()> {
ciborium::ser::into_writer(&self.index, wrt)
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))
}
}

Expand Down

0 comments on commit 5f565e7

Please sign in to comment.