Skip to content

Commit

Permalink
Remove some trait bounds
Browse files Browse the repository at this point in the history
Per review
  • Loading branch information
rkuris committed Aug 28, 2023
1 parent 9280fab commit a53eb56
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions firewood/src/v2/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub enum Error {
/// A range proof, consisting of a proof of the first key and the last key,
/// and a vector of all key/value pairs
#[derive(Debug)]
pub struct RangeProof<K: KeyType, V: ValueType, N: AsRef<[u8]> + Send> {
pub struct RangeProof<K, V, N> {
pub first_key: Proof<N>,
pub last_key: Proof<N>,
pub middle: Vec<(K, V)>,
Expand All @@ -79,7 +79,7 @@ pub struct RangeProof<K: KeyType, V: ValueType, N: AsRef<[u8]> + Send> {
///
/// The generic N represents the storage for the node data
#[derive(Debug)]
pub struct Proof<N: Send>(pub HashMap<HashKey, N>);
pub struct Proof<N>(pub HashMap<HashKey, N>);

/// The database interface, which includes a type for a static view of
/// the database (the DbView). The most common implementation of the DbView
Expand Down Expand Up @@ -147,7 +147,7 @@ pub trait DbView {
/// * `last_key` - If None, continue to the end of the database
/// * `limit` - The maximum number of keys in the range proof
///
async fn range_proof<K: KeyType, V: ValueType, N: AsRef<[u8]> + Send>(
async fn range_proof<K: KeyType, V, N>(
&self,
first_key: Option<K>,
last_key: Option<K>,
Expand Down
2 changes: 1 addition & 1 deletion firewood/src/v2/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl api::DbView for DbView {
todo!()
}

async fn range_proof<K: KeyType, V: ValueType, N: AsRef<[u8]> + Send>(
async fn range_proof<K: KeyType, V, N>(
&self,
_first_key: Option<K>,
_last_key: Option<K>,
Expand Down
2 changes: 1 addition & 1 deletion firewood/src/v2/emptydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl DbView for HistoricalImpl {
Ok(None)
}

async fn range_proof<K: KeyType, V: ValueType, N: AsRef<[u8]> + Send>(
async fn range_proof<K: KeyType, V, N>(
&self,
_first_key: Option<K>,
_last_key: Option<K>,
Expand Down
2 changes: 1 addition & 1 deletion firewood/src/v2/propose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<T: api::DbView + Send + Sync> api::DbView for Proposal<T> {
todo!()
}

async fn range_proof<KT: KeyType, VT: ValueType, NT: AsRef<[u8]> + Send>(
async fn range_proof<KT: KeyType, VT, NT>(
&self,
_first_key: Option<KT>,
_last_key: Option<KT>,
Expand Down

0 comments on commit a53eb56

Please sign in to comment.