We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e96557 commit 2ce0a2fCopy full SHA for 2ce0a2f
crates/net/p2p/src/full_block.rs
@@ -145,12 +145,7 @@ where
145
146
/// Returns the [`SealedBlock`] if the request is complete and valid.
147
fn take_block(&mut self) -> Option<SealedBlock<Client::Block>> {
148
- if self.header.is_none() || self.body.is_none() {
149
- return None
150
- }
151
-
152
- let header = self.header.take().unwrap();
153
- let resp = self.body.take().unwrap();
+ let (header, resp) = (self.header.take()?, self.body.take()?);
154
match resp {
155
BodyResponse::Validated(body) => Some(SealedBlock::from_sealed_parts(header, body)),
156
BodyResponse::PendingValidation(resp) => {
0 commit comments