clippy
This commit is contained in:
@@ -96,7 +96,7 @@ impl NotificationManager {
|
||||
|
||||
let sender2 = self.tx_toast.clone();
|
||||
let result = c.add_match(rule_with_eavesdrop, move |_: (), _, msg| {
|
||||
if let Ok(toast) = parse_dbus(&msg) {
|
||||
if let Ok(toast) = parse_dbus(msg) {
|
||||
match sender2.try_send(toast) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
|
||||
@@ -101,7 +101,7 @@ impl From<OVRError> for BackendError {
|
||||
|
||||
use cstr::cstr;
|
||||
const STEAMVR_SECTION: &CStr = cstr!("steamvr");
|
||||
const COLOR_GAIN_CSTR: [&'static CStr; 3] = [
|
||||
const COLOR_GAIN_CSTR: [&CStr; 3] = [
|
||||
cstr!("hmdDisplayColorGainR"),
|
||||
cstr!("hmdDisplayColorGainG"),
|
||||
cstr!("hmdDisplayColorGainB"),
|
||||
|
||||
@@ -15,7 +15,7 @@ pub(super) fn install_manifest(app_mgr: &mut ApplicationsManager) -> anyhow::Res
|
||||
let executable_pathbuf = std::env::current_exe()?;
|
||||
|
||||
let executable_path = match appimage_path {
|
||||
Ok(ref path) => &path,
|
||||
Ok(ref path) => path,
|
||||
Err(_) => executable_pathbuf
|
||||
.to_str()
|
||||
.ok_or_else(|| anyhow::anyhow!("Invalid executable path"))?,
|
||||
|
||||
@@ -474,7 +474,7 @@ fn run_watch(data: &WatchAction, app: &mut AppState) {
|
||||
app.tasks.enqueue(TaskType::Overlay(
|
||||
OverlaySelector::Name(WATCH_NAME.into()),
|
||||
Box::new(move |app, o| {
|
||||
o.spawn_rotation = o.spawn_rotation * rot;
|
||||
o.spawn_rotation *= rot;
|
||||
app.session.config.watch_rot = o.spawn_rotation.into();
|
||||
o.dirty = true;
|
||||
}),
|
||||
|
||||
@@ -92,7 +92,7 @@ pub fn modular_label_init(label: &mut ModularControl, content: &LabelContent) {
|
||||
child: None,
|
||||
}),
|
||||
LabelContent::Static { text } => {
|
||||
label.set_text(&text);
|
||||
label.set_text(text);
|
||||
None
|
||||
}
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ pub fn modular_canvas(
|
||||
rect: [x, y, w, h],
|
||||
bg_color,
|
||||
} => {
|
||||
canvas.bg_color = color_parse(&bg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.bg_color = color_parse(bg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.panel(*x, *y, *w, *h);
|
||||
}
|
||||
ModularElement::Label {
|
||||
@@ -140,9 +140,9 @@ pub fn modular_canvas(
|
||||
data,
|
||||
} => {
|
||||
canvas.font_size = *font_size;
|
||||
canvas.fg_color = color_parse(&fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
let mut label = canvas.label(*x, *y, *w, *h, empty_str.clone());
|
||||
modular_label_init(&mut label, data);
|
||||
canvas.fg_color = color_parse(fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
let label = canvas.label(*x, *y, *w, *h, empty_str.clone());
|
||||
modular_label_init(label, data);
|
||||
}
|
||||
ModularElement::Button {
|
||||
rect: [x, y, w, h],
|
||||
@@ -152,8 +152,8 @@ pub fn modular_canvas(
|
||||
text,
|
||||
data,
|
||||
} => {
|
||||
canvas.bg_color = color_parse(&bg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.fg_color = color_parse(&fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.bg_color = color_parse(bg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.fg_color = color_parse(fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.font_size = *font_size;
|
||||
let button = canvas.button(*x, *y, *w, *h, text.clone());
|
||||
modular_button_init(button, data);
|
||||
@@ -177,7 +177,7 @@ pub fn modular_canvas(
|
||||
ListLayout::Vertical => (*w, *h / num_buttons),
|
||||
};
|
||||
|
||||
let fg_color = color_parse(&fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
let fg_color = color_parse(fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.font_size = *font_size;
|
||||
canvas.fg_color = fg_color;
|
||||
|
||||
@@ -225,8 +225,8 @@ pub fn modular_canvas(
|
||||
ListLayout::Vertical => (*w, *h / num_buttons),
|
||||
};
|
||||
|
||||
canvas.bg_color = color_parse(&bg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.fg_color = color_parse(&fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.bg_color = color_parse(bg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.fg_color = color_parse(fg_color).unwrap_or(FALLBACK_COLOR);
|
||||
canvas.font_size = *font_size;
|
||||
|
||||
for screen in state.screens.iter() {
|
||||
|
||||
@@ -44,7 +44,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let args = Args::parse();
|
||||
if let Some(ref log_to) = args.log_to {
|
||||
flexi_logger::Logger::try_with_env_or_str("info")?
|
||||
.log_to_file(FileSpec::default().directory(&log_to))
|
||||
.log_to_file(FileSpec::default().directory(log_to))
|
||||
.log_to_stdout()
|
||||
.start()?;
|
||||
println!("Logging to: {}", &log_to);
|
||||
|
||||
@@ -95,8 +95,8 @@ fn get_config_path() -> PathBuf {
|
||||
}
|
||||
pub fn save_watch(app: &mut AppState) -> anyhow::Result<()> {
|
||||
let conf = WatchConf {
|
||||
watch_pos: app.session.config.watch_pos.clone(),
|
||||
watch_rot: app.session.config.watch_rot.clone(),
|
||||
watch_pos: app.session.config.watch_pos,
|
||||
watch_rot: app.session.config.watch_rot,
|
||||
watch_hand: app.session.config.watch_hand,
|
||||
watch_view_angle_min: app.session.config.watch_view_angle_min,
|
||||
watch_view_angle_max: app.session.config.watch_view_angle_max,
|
||||
|
||||
Reference in New Issue
Block a user