Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary parentheses #3181

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions chain/src/txhashset/txhashset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ impl<'a> Extension<'a> {
}
}

fn apply_output(&mut self, out: &Output) -> Result<(u64), Error> {
fn apply_output(&mut self, out: &Output) -> Result<u64, Error> {
let commit = out.commitment();

if let Ok(pos) = self.batch.get_output_pos(&commit) {
Expand Down Expand Up @@ -1229,7 +1229,7 @@ impl<'a> Extension<'a> {
pub fn validate_kernel_sums(
&self,
genesis: &BlockHeader,
) -> Result<((Commitment, Commitment)), Error> {
) -> Result<(Commitment, Commitment), Error> {
let now = Instant::now();

let head_header = self.batch.get_block_header(&self.head.last_block_h)?;
Expand All @@ -1253,7 +1253,7 @@ impl<'a> Extension<'a> {
genesis: &BlockHeader,
fast_validation: bool,
status: &dyn TxHashsetWriteStatus,
) -> Result<((Commitment, Commitment)), Error> {
) -> Result<(Commitment, Commitment), Error> {
self.validate_mmrs()?;
self.validate_roots()?;
self.validate_sizes()?;
Expand Down
2 changes: 1 addition & 1 deletion core/src/core/committed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub trait Committed {
&self,
overage: i64,
kernel_offset: BlindingFactor,
) -> Result<((Commitment, Commitment)), Error> {
) -> Result<(Commitment, Commitment), Error> {
// Sum all input|output|overage commitments.
let utxo_sum = self.sum_commitments(overage)?;

Expand Down
4 changes: 2 additions & 2 deletions store/src/pmmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<T: PMMRable> Backend<T> for PMMRBackend<T> {
/// Get the hash at pos.
/// Return None if pos is a leaf and it has been removed (or pruned or
/// compacted).
fn get_hash(&self, pos: u64) -> Option<(Hash)> {
fn get_hash(&self, pos: u64) -> Option<Hash> {
if self.prunable && pmmr::is_leaf(pos) && !self.leaf_set.includes(pos) {
return None;
}
Expand All @@ -119,7 +119,7 @@ impl<T: PMMRable> Backend<T> for PMMRBackend<T> {

/// Get the data at pos.
/// Return None if it has been removed or if pos is not a leaf node.
fn get_data(&self, pos: u64) -> Option<(T::E)> {
fn get_data(&self, pos: u64) -> Option<T::E> {
if !pmmr::is_leaf(pos) {
return None;
}
Expand Down