Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Use `.is_some_and()` instead of `.is_some() && .unwrap()` (#9704)

Waffle Maybeeec866075957
diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs
index fd266c57ece..3394c624f74 100644
--- a/crates/gpui/src/platform/linux/platform.rs
+++ b/crates/gpui/src/platform/linux/platform.rs
@@ -74,7 +74,7 @@ impl Default for LinuxPlatform {
impl LinuxPlatform {
pub(crate) fn new() -> Self {
let wayland_display = env::var_os("WAYLAND_DISPLAY");
- let use_wayland = wayland_display.is_some() && !wayland_display.unwrap().is_empty();
+ let use_wayland = wayland_display.is_some_and(|display| !display.is_empty());
let (main_sender, main_receiver) = calloop::channel::channel::<Runnable>();
let text_system = Arc::new(LinuxTextSystem::new());