chore: update Rust edition to 2024

This commit is contained in:
nekename committed 2025-06-01 18:36:22 +01:00
1 parent d7564bec37
commit 9bf74c6fdb
21 files changed
+28 -34

No files matched your search

@@ -3,7 +3,7 @@ name = "opendeck-starterpack"
version = "1.4.1"
authors = ["Aman Khanna (nekename)"]
license = "GPL-3.0-or-later"
edition = "2021"
edition = "2024"
[dependencies]
openaction = "1.1"
@@ -1,3 +1,2 @@
edition = "2021"
hard_tabs = true
newline_style = "Unix"
@@ -1,8 +1,8 @@
use openaction::*;
use enigo::{
agent::{Agent, Token},
Enigo, Settings,
agent::{Agent, Token},
};
pub fn key_down(event: KeyEvent) -> EventHandlerResult {
+1 -1
View File
@@ -6,7 +6,7 @@ authors = ["Aman Khanna (nekename)"]
license = "GPL-3.0-or-later"
repository = "https://github.com/nekename/OpenDeck"
default-run = "opendeck"
edition = "2021"
edition = "2024"
[build-dependencies]
tauri-build = { version = "2.2", features = [] }
-1
View File
@@ -1,4 +1,3 @@
edition = "2021"
hard_tabs = true
max_width = 200
newline_style = "Unix"
+1 -1
View File
@@ -3,7 +3,7 @@ use crate::events::outbound::{encoder, keypad};
use std::collections::HashMap;
use base64::Engine as _;
use elgato_streamdeck::{info::Kind, AsyncStreamDeck, DeviceStateUpdate};
use elgato_streamdeck::{AsyncStreamDeck, DeviceStateUpdate, info::Kind};
use once_cell::sync::Lazy;
use tokio::sync::RwLock;
+3 -3
View File
@@ -1,9 +1,9 @@
use super::Error;
use crate::shared::{config_dir, Action, ActionContext, ActionInstance, Context};
use crate::store::profiles::{acquire_locks_mut, get_instance_mut, get_slot_mut, save_profile, LocksMut};
use crate::shared::{Action, ActionContext, ActionInstance, Context, config_dir};
use crate::store::profiles::{LocksMut, acquire_locks_mut, get_instance_mut, get_slot_mut, save_profile};
use tauri::{command, AppHandle, Emitter, Manager};
use tauri::{AppHandle, Emitter, Manager, command};
use tokio::fs::remove_dir_all;
#[command]
+2 -2
View File
@@ -4,11 +4,11 @@ pub mod profiles;
pub mod property_inspector;
pub mod settings;
use crate::shared::{Action, DeviceInfo, CATEGORIES, DEVICES};
use crate::shared::{Action, CATEGORIES, DEVICES, DeviceInfo};
use std::collections::HashMap;
use tauri::{command, Emitter, Manager};
use tauri::{Emitter, Manager, command};
#[derive(Debug, serde_with::SerializeDisplay, serde::Deserialize)]
pub struct Error {
+1 -1
View File
@@ -2,7 +2,7 @@ use crate::shared::{config_dir, log_dir};
use super::Error;
use tauri::{command, AppHandle, Manager};
use tauri::{AppHandle, Manager, command};
use tokio::fs;
#[derive(serde::Serialize)]
+2 -2
View File
@@ -1,9 +1,9 @@
use super::Error;
use crate::shared::DEVICES;
use crate::store::profiles::{acquire_locks_mut, get_device_profiles, PROFILE_STORES};
use crate::store::profiles::{PROFILE_STORES, acquire_locks_mut, get_device_profiles};
use tauri::{command, AppHandle, Emitter, Manager};
use tauri::{AppHandle, Emitter, Manager, command};
#[command]
pub fn get_profiles(device: &str) -> Result<Vec<String>, Error> {
+2 -2
View File
@@ -6,11 +6,11 @@ use inbound::RegisterEvent;
use std::collections::HashMap;
use futures::{stream::SplitSink, SinkExt, StreamExt};
use futures::{SinkExt, StreamExt, stream::SplitSink};
use once_cell::sync::Lazy;
use tokio::net::TcpStream;
use tokio::sync::{Mutex, RwLock};
use tokio_tungstenite::{tungstenite::Message, WebSocketStream};
use tokio_tungstenite::{WebSocketStream, tungstenite::Message};
type Sockets = Lazy<Mutex<HashMap<String, SplitSink<WebSocketStream<TcpStream>, Message>>>>;
static PLUGIN_SOCKETS: Sockets = Lazy::new(|| Mutex::new(HashMap::new()));
+1 -1
View File
@@ -1,6 +1,6 @@
use super::{send_to_all_plugins, send_to_plugin};
use crate::plugins::{info_param::DeviceInfo, DEVICE_NAMESPACES};
use crate::plugins::{DEVICE_NAMESPACES, info_param::DeviceInfo};
use serde::Serialize;
+1 -1
View File
@@ -1,4 +1,4 @@
use super::{send_to_plugin, Coordinates};
use super::{Coordinates, send_to_plugin};
use crate::shared::ActionContext;
use crate::store::profiles::{acquire_locks_mut, get_instance_mut};
+1 -1
View File
@@ -1,6 +1,6 @@
use std::time::Duration;
use super::{send_to_plugin, GenericInstancePayload};
use super::{GenericInstancePayload, send_to_plugin};
use crate::events::frontend::instances::{key_moved, update_state};
use crate::shared::{ActionContext, Context};
+1 -1
View File
@@ -1,4 +1,4 @@
use super::{send_to_plugin, send_to_property_inspector, GenericInstancePayload};
use super::{GenericInstancePayload, send_to_plugin, send_to_property_inspector};
use crate::shared::ActionContext;
+1 -1
View File
@@ -1,4 +1,4 @@
use super::{send_to_plugin, Coordinates};
use super::{Coordinates, send_to_plugin};
use crate::shared::{ActionContext, ActionInstance};
+1 -1
View File
@@ -1,4 +1,4 @@
use super::{send_to_plugin, GenericInstancePayload};
use super::{GenericInstancePayload, send_to_plugin};
use crate::shared::{ActionContext, ActionInstance};
+1 -1
View File
@@ -17,9 +17,9 @@ use events::frontend;
use once_cell::sync::OnceCell;
use tauri::{
AppHandle, Builder, Manager, WindowEvent,
menu::{IconMenuItemBuilder, MenuBuilder, MenuItemBuilder, PredefinedMenuItem},
tray::{TrayIconBuilder, TrayIconEvent},
AppHandle, Builder, Manager, WindowEvent,
};
use tauri_plugin_log::{Target, TargetKind};
+2 -2
View File
@@ -2,9 +2,9 @@ pub mod info_param;
pub mod manifest;
mod webserver;
use crate::shared::{config_dir, convert_icon, log_dir, Action, CATEGORIES};
use crate::store::get_settings;
use crate::APP_HANDLE;
use crate::shared::{Action, CATEGORIES, config_dir, convert_icon, log_dir};
use crate::store::get_settings;
use std::collections::HashMap;
use std::process::{Child, Command, Stdio};
+1 -1
View File
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use std::path::Path;
use serde::{de::Visitor, Deserialize, Deserializer, Serialize};
use serde::{Deserialize, Deserializer, Serialize, de::Visitor};
use serde_inline_default::serde_inline_default;
use dashmap::DashMap;
+4 -8
View File
@@ -1,8 +1,8 @@
use super::{
simplified_profile::{DiskActionInstance, DiskProfile},
Store,
simplified_profile::{DiskActionInstance, DiskProfile},
};
use crate::shared::{config_dir, Action, ActionInstance, ActionState, DeviceInfo, Profile, DEVICES};
use crate::shared::{Action, ActionInstance, ActionState, DEVICES, DeviceInfo, Profile, config_dir};
use std::collections::HashMap;
use std::fs;
@@ -11,7 +11,7 @@ use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use anyhow::{anyhow, Context};
use anyhow::{Context, anyhow};
use once_cell::sync::Lazy;
use tokio::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard};
@@ -127,11 +127,7 @@ impl DeviceStores {
let from_store = &self.stores.get(device).unwrap().value.selected_profile;
let all = get_device_profiles(device)?;
if all.contains(from_store) {
Ok(from_store.clone())
} else {
Ok(all.first().unwrap().clone())
}
if all.contains(from_store) { Ok(from_store.clone()) } else { Ok(all.first().unwrap().clone()) }
}
pub fn set_selected_profile(&mut self, device: &str, id: String) -> Result<(), anyhow::Error> {