block: use inspect_err instead of map_err

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2024-07-23 19:33:28 +00:00 committed by Rob Bradford
parent 61a5bae25c
commit 7e749c0390

View File

@ -248,9 +248,8 @@ impl Request {
let hdr_desc = desc_chain
.next()
.ok_or(Error::DescriptorChainTooShort)
.map_err(|e| {
.inspect_err(|_| {
error!("Missing head descriptor");
e
})?;
// The head contains the request type which MUST be readable.
@ -276,9 +275,8 @@ impl Request {
let mut desc = desc_chain
.next()
.ok_or(Error::DescriptorChainTooShort)
.map_err(|e| {
.inspect_err(|_| {
error!("Only head descriptor present: request = {:?}", req);
e
})?;
if !desc.has_next() {
@ -309,9 +307,8 @@ impl Request {
desc = desc_chain
.next()
.ok_or(Error::DescriptorChainTooShort)
.map_err(|e| {
.inspect_err(|_| {
error!("DescriptorChain corrupted: request = {:?}", req);
e
})?;
}
status_desc = desc;