Skip to content

Commit

Permalink
engine_traits: some syntactic changes
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Anderson <andersrb@gmail.com>
  • Loading branch information
brson committed Feb 19, 2020
1 parent 24438e4 commit c810466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
6 changes: 2 additions & 4 deletions components/engine_rocks/src/table_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ use crate::properties::DecodeProperties;

impl DecodeProperties for RocksUserCollectedProperties {
fn decode(&self, k: &str) -> tikv_util::codec::Result<&[u8]> {
match self.get(k.as_bytes()) {
Some(v) => Ok(v),
None => Err(tikv_util::codec::Error::KeyNotFound),
}
self.get(k.as_bytes())
.ok_or(tikv_util::codec::Error::KeyNotFound)
}
}
9 changes: 2 additions & 7 deletions components/engine_traits/src/table_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,15 @@ where
}
}

pub trait TablePropertiesCollectionIter<PKey, P, UCP>
pub trait TablePropertiesCollectionIter<PKey, P, UCP>: Iterator<Item = (PKey, P)>
where
Self: Iterator<Item = (PKey, P)>,
PKey: TablePropertiesKey,
P: TableProperties<UCP>,
UCP: UserCollectedProperties,
{
}

pub trait TablePropertiesKey
where
Self: Deref<Target = str>,
{
}
pub trait TablePropertiesKey: Deref<Target = str> {}

pub trait TableProperties<UCP>
where
Expand Down

0 comments on commit c810466

Please sign in to comment.