From 86d9f49473485e06b70691e93eef3cff8a943d61 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Fri, 17 Jul 2026 15:38:12 +0200 Subject: [PATCH] style(pf-vdisplay): rustfmt under the pinned 1.96.0 toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The W6.2 pf-vdisplay extraction (27a5d8da) committed six spots that the pinned rustfmt (rust-toolchain.toml = 1.96.0) reformats — a short closure collapse and chain-call wrapping. No semantic change; makes cargo fmt --all --check green so the combined push does not land CI red on pre-existing format drift. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/pf-vdisplay/src/vdisplay/linux/gamescope.rs | 4 +--- crates/pf-vdisplay/src/vdisplay/linux/mutter.rs | 5 +---- crates/pf-vdisplay/src/vdisplay/windows/manager.rs | 12 ++---------- .../src/vdisplay/windows/manager/knobs.rs | 5 +---- .../pf-vdisplay/src/vdisplay/windows/pf_vdisplay.rs | 5 +---- 5 files changed, 6 insertions(+), 25 deletions(-) diff --git a/crates/pf-vdisplay/src/vdisplay/linux/gamescope.rs b/crates/pf-vdisplay/src/vdisplay/linux/gamescope.rs index 9b2fba0e..f1ca1a31 100644 --- a/crates/pf-vdisplay/src/vdisplay/linux/gamescope.rs +++ b/crates/pf-vdisplay/src/vdisplay/linux/gamescope.rs @@ -1397,9 +1397,7 @@ fn spawn(w: u32, h: u32, hz: u32, cmd: Option<&str>, log: &std::path::Path) -> R .filter(|s| !s.trim().is_empty()) // Read the env fallback under the shared env lock so it can't race a concurrent session's // `set_var` of the same key (security-review 2026-06-28 #7). - .or_else(|| { - crate::with_env_lock(|| std::env::var("PUNKTFUNK_GAMESCOPE_APP").ok()) - }) + .or_else(|| crate::with_env_lock(|| std::env::var("PUNKTFUNK_GAMESCOPE_APP").ok())) .filter(|s| !s.trim().is_empty()) .unwrap_or_else(|| "sleep infinity".to_string()); // Dedicated-launch command shaping (Part B): a Steam URI runs with `-silent` so the game is the diff --git a/crates/pf-vdisplay/src/vdisplay/linux/mutter.rs b/crates/pf-vdisplay/src/vdisplay/linux/mutter.rs index 539adc19..3ef19cb3 100644 --- a/crates/pf-vdisplay/src/vdisplay/linux/mutter.rs +++ b/crates/pf-vdisplay/src/vdisplay/linux/mutter.rs @@ -133,10 +133,7 @@ impl VirtualDisplay for MutterDisplay { (mode.width, mode.height), crate::policy::Identity::Shared, ); - let remembered_scale = crate::identity::scales() - .lock() - .unwrap() - .get(&scale_key); + let remembered_scale = crate::identity::scales().lock().unwrap().get(&scale_key); if let Some(scale) = remembered_scale { tracing::info!(scale, "mutter: reapplying the client's saved display scale"); } diff --git a/crates/pf-vdisplay/src/vdisplay/windows/manager.rs b/crates/pf-vdisplay/src/vdisplay/windows/manager.rs index 650a0ed9..d075a6cd 100644 --- a/crates/pf-vdisplay/src/vdisplay/windows/manager.rs +++ b/crates/pf-vdisplay/src/vdisplay/windows/manager.rs @@ -532,10 +532,7 @@ impl VirtualDisplayManager { // (`max_displays` across Active+Lingering+Pinned slots; the identity-slot ceiling of 15 is // the hard limit behind it) — this is the fail-closed backstop for a session that got past // admission anyway. One live slot can never trip it (max_displays >= 1). - let max = crate::policy::prefs() - .get() - .effective() - .max_displays; + let max = crate::policy::prefs().get().effective().max_displays; if inner.slots.len() as u32 >= max { anyhow::bail!( "display budget exhausted: {} display(s) live/kept, max_displays = {max} — freeing \ @@ -1450,12 +1447,7 @@ impl Drop for MonitorLease { /// no identity to find any other slot by). Shared by `acquire` and the session setup's /// [`VirtualDisplayManager::begin_idd_setup`], so both address the same slot. pub fn slot_id_for(client_fp: Option<[u8; 32]>, mode: (u32, u32)) -> u32 { - super::identity::resolve_slot( - client_fp, - mode, - crate::policy::Identity::PerClient, - ) - .unwrap_or(0) + super::identity::resolve_slot(client_fp, mode, crate::policy::Identity::PerClient).unwrap_or(0) } /// The render-GPU pin (backend-neutral): IDD-push — the sole Windows capture path — runs NVENC on the diff --git a/crates/pf-vdisplay/src/vdisplay/windows/manager/knobs.rs b/crates/pf-vdisplay/src/vdisplay/windows/manager/knobs.rs index 928bda11..dc8ce4fb 100644 --- a/crates/pf-vdisplay/src/vdisplay/windows/manager/knobs.rs +++ b/crates/pf-vdisplay/src/vdisplay/windows/manager/knobs.rs @@ -41,10 +41,7 @@ pub(super) fn keep_alive_forever() -> bool { /// physical(s) so the IDD is the sole composited desktop. pub(super) fn topology_action() -> crate::policy::Topology { use crate::policy::Topology; - if crate::policy::prefs() - .configured_effective() - .is_some() - { + if crate::policy::prefs().configured_effective().is_some() { return crate::effective_topology(); } if std::env::var("PUNKTFUNK_NO_ISOLATE").is_ok() { diff --git a/crates/pf-vdisplay/src/vdisplay/windows/pf_vdisplay.rs b/crates/pf-vdisplay/src/vdisplay/windows/pf_vdisplay.rs index cefa9716..dc006b5f 100644 --- a/crates/pf-vdisplay/src/vdisplay/windows/pf_vdisplay.rs +++ b/crates/pf-vdisplay/src/vdisplay/windows/pf_vdisplay.rs @@ -217,10 +217,7 @@ unsafe fn set_render_adapter(h: HANDLE, luid: LUID) -> Result<()> { /// /// # Safety /// `dev` must be a live pf-vdisplay control handle (see [`super::manager::control_device_handle`]). -pub unsafe fn send_frame_channel( - dev: HANDLE, - req: &control::SetFrameChannelRequest, -) -> Result<()> { +pub unsafe fn send_frame_channel(dev: HANDLE, req: &control::SetFrameChannelRequest) -> Result<()> { let mut none: [u8; 0] = []; // SAFETY: per this fn's contract `dev` is the live control handle. `bytes_of(req)` borrows the // caller's request for the duration of this synchronous call as the input bytes; `none` is empty,