style(mac): use Option::filter for the non-empty window name (clippy::manual_filter)

window.rs WindowInfo::from(&CFDictionary) spelled filter by hand with and_then; an empty name is still None.

No behaviour change. Pre-existing on the original macOS tip 9a58e511 (reported by cargo clippy --all-targets -D warnings on the Mini, stable 1.93).

Verified: fake-CC cargo clippy --locked --target aarch64-apple-darwin -p komorebi --all-targets -D warnings no longer reports this lint (see the last hygiene revision for the whole run). Verified on the Mini: not yet.
This commit is contained in:
LGUG2Z committed 2026-10-31 12:37:12 -07:00
1 parent 552ab43701
commit 756a03cc77
1 file changed
+1 -1
+1 -1
View File
@@ -1587,7 +1587,7 @@ impl From<&CFDictionary> for WindowInfo {
Self {
name: cf_dictionary_value::<CFString>(value, kCGWindowName)
.map(|s| s.as_ref().to_string())
.and_then(|s| if s.is_empty() { None } else { Some(s) }),
.filter(|s| !s.is_empty()),
owner_pid: cf_dictionary_value::<CFNumber>(value, kCGWindowOwnerPID)
.and_then(|s| s.as_ref().as_i32())
.expect("window must have an owner process id"),