diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 9ccf595893..61998b5de3 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -536,7 +536,7 @@ impl BeaconChain { /// If valid, the attestation is added to `self.op_pool` and `self.fork_choice`. /// /// Returns an `Ok(AttestationProcessingOutcome)` if the chain was able to make a determination - /// about the `attestation` (wether it was invalid or not). Returns an `Err` if the was an + /// about the `attestation` (whether it was invalid or not). Returns an `Err` if there was an /// error during this process and no determination was able to be made. /// /// ## Notes @@ -617,7 +617,7 @@ impl BeaconChain { outcome } else { // Use the `data.beacon_block_root` to load the state from the latest non-skipped - // slot preceding the attestations creation. + // slot preceding the attestation's creation. // // This state is guaranteed to be in the same chain as the attestation, but it's // not guaranteed to be from the same slot or epoch as the attestation. @@ -692,7 +692,7 @@ impl BeaconChain { /// The given `state` must fulfil one of the following conditions: /// /// - `state` corresponds to the `block.state_root` identified by - /// `attestation.data.beacon_block_root`. (Viz., `attestation` was created using `state`. + /// `attestation.data.beacon_block_root`. (Viz., `attestation` was created using `state`). /// - `state.slot` is in the same epoch as `data.target.epoch` and /// `attestation.data.beacon_block_root` is in the history of `state`. /// diff --git a/eth2/lmd_ghost/src/reduced_tree.rs b/eth2/lmd_ghost/src/reduced_tree.rs index 822c388f6a..deda02e1fd 100644 --- a/eth2/lmd_ghost/src/reduced_tree.rs +++ b/eth2/lmd_ghost/src/reduced_tree.rs @@ -777,11 +777,7 @@ where } pub fn get_ref(&self, i: usize) -> Option<&T> { - if i < self.0.len() { - Some(&self.0[i]) - } else { - None - } + self.0.get(i) } pub fn insert(&mut self, i: usize, element: T) {