clippy
This commit is contained in:
@@ -7,8 +7,9 @@ use dbus::{
|
||||
use serde::Deserialize;
|
||||
use std::{
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
mpsc, Arc,
|
||||
mpsc,
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
@@ -172,7 +173,7 @@ impl NotificationManager {
|
||||
let toast = Toast::new(
|
||||
ToastTopic::XSNotification,
|
||||
msg.title,
|
||||
msg.content.unwrap_or_else(|| "".into()),
|
||||
msg.content.unwrap_or(String::new()),
|
||||
)
|
||||
.with_timeout(msg.timeout.unwrap_or(5.))
|
||||
.with_sound(msg.volume.unwrap_or(-1.) >= 0.); // XSOverlay still plays at 0,
|
||||
@@ -264,11 +265,9 @@ fn parse_dbus(msg: &dbus::Message) -> anyhow::Result<Toast> {
|
||||
summary
|
||||
};
|
||||
|
||||
Ok(
|
||||
Toast::new(ToastTopic::DesktopNotification, title.into(), body.into())
|
||||
.with_timeout(5.0)
|
||||
.with_opacity(1.0),
|
||||
)
|
||||
Ok(Toast::new(ToastTopic::DesktopNotification, title, body)
|
||||
.with_timeout(5.0)
|
||||
.with_opacity(1.0))
|
||||
// leave the audio part to the desktop env
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,18 @@ use std::{
|
||||
collections::VecDeque,
|
||||
ops::Add,
|
||||
sync::{
|
||||
atomic::{AtomicBool, AtomicUsize, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicBool, AtomicUsize, Ordering},
|
||||
},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use ovr_overlay::{
|
||||
sys::{ETrackedDeviceProperty, EVRApplicationType, EVREventType},
|
||||
TrackedDeviceIndex,
|
||||
sys::{ETrackedDeviceProperty, EVRApplicationType, EVREventType},
|
||||
};
|
||||
use vulkano::{device::physical::PhysicalDevice, Handle, VulkanObject};
|
||||
use vulkano::{Handle, VulkanObject, device::physical::PhysicalDevice};
|
||||
|
||||
use crate::{
|
||||
backend::{
|
||||
@@ -22,7 +22,7 @@ use crate::{
|
||||
notifications::NotificationManager,
|
||||
openvr::{
|
||||
helpers::adjust_gain,
|
||||
input::{set_action_manifest, OpenVrInputSource},
|
||||
input::{OpenVrInputSource, set_action_manifest},
|
||||
lines::LinePool,
|
||||
manifest::{install_manifest, uninstall_manifest},
|
||||
overlay::OpenVrOverlayData,
|
||||
@@ -30,10 +30,10 @@ use crate::{
|
||||
overlay::{OverlayData, ShouldRender},
|
||||
task::{SystemTask, TaskType},
|
||||
},
|
||||
graphics::{init_openvr_graphics, CommandBuffers},
|
||||
graphics::{CommandBuffers, init_openvr_graphics},
|
||||
overlays::{
|
||||
toast::{Toast, ToastTopic},
|
||||
watch::{watch_fade, WATCH_NAME},
|
||||
watch::{WATCH_NAME, watch_fade},
|
||||
},
|
||||
state::AppState,
|
||||
};
|
||||
@@ -185,12 +185,8 @@ pub fn openvr_run(
|
||||
let ipd = (ipd * 10000.0).round() * 0.1;
|
||||
if (ipd - state.input_state.ipd).abs() > 0.05 {
|
||||
log::info!("IPD: {:.1} mm -> {:.1} mm", state.input_state.ipd, ipd);
|
||||
Toast::new(
|
||||
ToastTopic::IpdChange,
|
||||
"IPD".into(),
|
||||
format!("{ipd:.1} mm").into(),
|
||||
)
|
||||
.submit(&mut state);
|
||||
Toast::new(ToastTopic::IpdChange, "IPD".into(), format!("{ipd:.1} mm"))
|
||||
.submit(&mut state);
|
||||
}
|
||||
state.input_state.ipd = ipd;
|
||||
}
|
||||
|
||||
@@ -330,12 +330,8 @@ pub fn openxr_run(
|
||||
if (app.input_state.ipd - ipd).abs() > 0.01 {
|
||||
log::info!("IPD changed: {} -> {}", app.input_state.ipd, ipd);
|
||||
app.input_state.ipd = ipd;
|
||||
Toast::new(
|
||||
ToastTopic::IpdChange,
|
||||
"IPD".into(),
|
||||
format!("{ipd:.1} mm").into(),
|
||||
)
|
||||
.submit(&mut app);
|
||||
Toast::new(ToastTopic::IpdChange, "IPD".into(), format!("{ipd:.1} mm"))
|
||||
.submit(&mut app);
|
||||
}
|
||||
|
||||
overlays
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use crate::state::AppState;
|
||||
|
||||
use super::{display, process, window, TickTask, WayVRSignal};
|
||||
use super::{TickTask, WayVRSignal, display, process, window};
|
||||
use bytes::BufMut;
|
||||
use glam::Vec3A;
|
||||
use interprocess::local_socket::{self, traits::Listener, ToNsName};
|
||||
use interprocess::local_socket::{self, ToNsName, traits::Listener};
|
||||
use smallvec::SmallVec;
|
||||
use std::io::{Read, Write};
|
||||
use wayvr_ipc::{
|
||||
@@ -81,11 +81,10 @@ pub fn gen_args_vec(input: &str) -> Vec<&str> {
|
||||
}
|
||||
|
||||
pub fn gen_env_vec(input: &[String]) -> Vec<(&str, &str)> {
|
||||
let res = input
|
||||
input
|
||||
.iter()
|
||||
.filter_map(|e| e.as_str().split_once('='))
|
||||
.collect();
|
||||
res
|
||||
.collect()
|
||||
}
|
||||
|
||||
impl Connection {
|
||||
|
||||
Reference in New Issue
Block a user