Skip to content

Commit 31899c5

Browse files
committed
fix lint issues
Signed-off-by: chang-ning <spiderpower02@gmail.com>
1 parent b6a2ad7 commit 31899c5

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/stat.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,11 @@ fn parse_single_qp(nla: &Nla, dev_name: &str) -> Option<QpInfo> {
177177
for attr in nla.nested() {
178178
match attr.attr_type {
179179
RDMA_NLDEV_ATTR_RES_LQPN => qp.lqpn = attr.u32(),
180-
RDMA_NLDEV_ATTR_RES_TYPE => {
181-
if !attr.data.is_empty() {
182-
qp.qp_type = attr.data[0];
183-
}
180+
RDMA_NLDEV_ATTR_RES_TYPE if !attr.data.is_empty() => {
181+
qp.qp_type = attr.data[0];
184182
}
185-
RDMA_NLDEV_ATTR_RES_STATE => {
186-
if !attr.data.is_empty() {
187-
qp.state = attr.data[0];
188-
}
183+
RDMA_NLDEV_ATTR_RES_STATE if !attr.data.is_empty() => {
184+
qp.state = attr.data[0];
189185
}
190186
RDMA_NLDEV_ATTR_RES_PID => {
191187
qp.pid = attr.u32();

0 commit comments

Comments
 (0)