Skip to content

Commit

Permalink
std::result::Result -> Result
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Oct 3, 2023
1 parent 993a772 commit 66068fd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/interfaces/src/blockchain_tree/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub enum BlockchainTreeError {
}

/// Result alias for `CanonicalError`
pub type CanonicalResult<T> = std::result::Result<T, CanonicalError>;
pub type CanonicalResult<T> = Result<T, CanonicalError>;

/// Canonical Errors
#[allow(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl FsPathError {
}
}

type Result<T> = std::result::Result<T, FsPathError>;
type Result<T> = Result<T, FsPathError>;

/// Wrapper for `std::fs::read_to_string`
pub fn read_to_string(path: impl AsRef<Path>) -> Result<String> {
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc/src/eth/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use reth_rpc_types::TypedTransactionRequest;
use secp256k1::SecretKey;
use std::collections::HashMap;

type Result<T> = std::result::Result<T, SignError>;
type Result<T> = Result<T, SignError>;

/// An Ethereum Signer used via RPC.
#[async_trait::async_trait]
Expand Down
4 changes: 1 addition & 3 deletions crates/rpc/rpc/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ impl<Provider, Eth> TraceApi<Provider, Eth> {
}

/// Acquires a permit to execute a tracing call.
async fn acquire_trace_permit(
&self,
) -> std::result::Result<OwnedSemaphorePermit, AcquireError> {
async fn acquire_trace_permit(&self) -> Result<OwnedSemaphorePermit, AcquireError> {
self.inner.tracing_call_guard.clone().acquire_owned().await
}
}
Expand Down
9 changes: 3 additions & 6 deletions crates/storage/provider/src/providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,17 +557,14 @@ where
DB: Send + Sync,
Tree: BlockchainTreeEngine,
{
fn buffer_block(
&self,
block: SealedBlockWithSenders,
) -> std::result::Result<(), InsertBlockError> {
fn buffer_block(&self, block: SealedBlockWithSenders) -> Result<(), InsertBlockError> {
self.tree.buffer_block(block)
}

fn insert_block(
&self,
block: SealedBlockWithSenders,
) -> std::result::Result<InsertPayloadOk, InsertBlockError> {
) -> Result<InsertPayloadOk, InsertBlockError> {
self.tree.insert_block(block)
}

Expand Down Expand Up @@ -628,7 +625,7 @@ where
self.tree.find_canonical_ancestor(hash)
}

fn is_canonical(&self, hash: BlockHash) -> std::result::Result<bool, RethError> {
fn is_canonical(&self, hash: BlockHash) -> Result<bool, RethError> {
self.tree.is_canonical(hash)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/storage/provider/src/providers/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ mod test {
B256::random(),
);

db.update(|tx| -> std::result::Result<(), DatabaseError> {
db.update(|tx| -> Result<(), DatabaseError> {
let mut td = U256::ZERO;
for header in headers.clone() {
td += header.header.difficulty;
Expand Down
3 changes: 1 addition & 2 deletions crates/trie/src/trie_cursor/account_cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ mod tests {
.unwrap();
}

let db_data =
cursor.walk_range(..).unwrap().collect::<std::result::Result<Vec<_>, _>>().unwrap();
let db_data = cursor.walk_range(..).unwrap().collect::<Result<Vec<_>, _>>().unwrap();
assert_eq!(db_data[0].0.inner.to_vec(), data[0]);
assert_eq!(db_data[1].0.inner.to_vec(), data[1]);
assert_eq!(db_data[2].0.inner.to_vec(), data[2]);
Expand Down

0 comments on commit 66068fd

Please sign in to comment.