Skip to content

Commit

Permalink
db_options: Impl Default for EncodingType manually
Browse files Browse the repository at this point in the history
This avoids having to bump the MSRV upstream.
  • Loading branch information
ayymart committed Jun 22, 2023
1 parent 2a23ac6 commit 1ad2e56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/db_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3584,10 +3584,9 @@ pub enum ChecksumType {

/// Used by [`PlainTableFactoryOptions`]
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EncodingType {
/// Always write full keys without any special encoding.
#[default]
Plain = 0,
/// Find opportunity to write the same prefix once for multiple rows.
/// In some cases, when a key follows a previous key with the same prefix,
Expand All @@ -3603,6 +3602,12 @@ pub enum EncodingType {
Prefix = 1,
}

impl Default for EncodingType {
fn default() -> Self {
Self::Plain
}
}

/// Used with DBOptions::set_plain_table_factory.
/// See official [wiki](https://github.com/facebook/rocksdb/wiki/PlainTable-Format) for more
/// information.
Expand Down

0 comments on commit 1ad2e56

Please sign in to comment.