From 9e1fb3bfa1083748c6d5c1ddf2a19fbd750db0e1 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Wed, 19 Feb 2025 16:07:50 +0800 Subject: [PATCH] misc: Fix clippy - manual implementation of ok Reported by 1.86.0-beta.1 (f0cb41030 2025-02-17). Signed-off-by: Ruoqing He --- arch/src/aarch64/fdt.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/src/aarch64/fdt.rs b/arch/src/aarch64/fdt.rs index 4d6f49d7b..3c3270ca6 100644 --- a/arch/src/aarch64/fdt.rs +++ b/arch/src/aarch64/fdt.rs @@ -1109,10 +1109,7 @@ fn print_node(node: fdt_parser::node::FdtNode<'_, '_>, n_spaces: usize) { // - At first, try to convert it to CStr and print, // - If failed, print it as u32 array. let value_result = match CStr::from_bytes_with_nul(value) { - Ok(value_cstr) => match value_cstr.to_str() { - Ok(value_str) => Some(value_str), - Err(_e) => None, - }, + Ok(value_cstr) => value_cstr.to_str().ok(), Err(_e) => None, };