Skip to content

Commit 5f565e7

Browse files
authored
Merge pull request #1604 from quickwit-oss/replace_cbor
replace cbor with cborium
2 parents c2f1c25 + 516e609 commit 5f565e7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ lru = "0.7.5"
5757
fastdivide = "0.4.0"
5858
itertools = "0.10.3"
5959
measure_time = "0.8.2"
60-
serde_cbor = { version = "0.11.2", optional = true }
60+
ciborium = { version = "0.2", optional = true}
6161
async-trait = "0.1.53"
6262
arc-swap = "1.5.0"
6363

@@ -101,7 +101,7 @@ zstd-compression = ["zstd"]
101101
failpoints = ["fail/failpoints"]
102102
unstable = [] # useful for benches.
103103

104-
quickwit = ["serde_cbor"]
104+
quickwit = ["ciborium"]
105105

106106
[workspace]
107107
members = ["query-grammar", "bitpacker", "common", "fastfield_codecs", "ownedbytes"]

src/termdict/sstable_termdict/sstable/sstable_index.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct SSTableIndex {
1313

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

@@ -85,9 +85,9 @@ impl SSTableIndexBuilder {
8585
})
8686
}
8787

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

0 commit comments

Comments
 (0)