Use let chain to avoid `clippy::unnecessary_unwrap` (#46409)
Martin Pool
created
No bug, just shows up running the tests on `clippy 0.1.92 (ded5c06cf2
2025-12-08)`
Release Notes:
- N/A
Change summary
crates/gpui/src/elements/div.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Detailed changes
@@ -1983,12 +1983,12 @@ impl Interactivity {
) {
use crate::{BorderStyle, TextAlign};
- if global_id.is_some()
+ if let Some(global_id) = global_id
&& (style.debug || style.debug_below || cx.has_global::<crate::DebugBelow>())
&& hitbox.is_hovered(window)
{
const FONT_SIZE: crate::Pixels = crate::Pixels(10.);
- let element_id = format!("{:?}", global_id.unwrap());
+ let element_id = format!("{global_id:?}");
let str_len = element_id.len();
let render_debug_text = |window: &mut Window| {