chore: cargo fmt

This commit is contained in:
2026-01-15 16:17:34 +08:00
parent 86d964943e
commit 41260c971a
8 changed files with 27 additions and 26 deletions

View File

@@ -1,9 +1,9 @@
use crate::{
lock_w,
services::client_config_manager::{
load_app_config, open_config_manager_window, save_app_config, AppConfig,
},
state::FDOLL,
lock_w,
};
#[tauri::command]

View File

@@ -1,10 +1,10 @@
use crate::{
lock_r,
remotes::{
dolls::{CreateDollDto, DollDto, DollsRemote, UpdateDollDto},
user::UserRemote,
},
state::{init_app_data_scoped, AppDataRefreshScope, FDOLL},
lock_r,
};
use tauri::async_runtime;

View File

@@ -1,7 +1,4 @@
use crate::{
models::interaction::SendInteractionDto,
services::interaction::send_interaction,
};
use crate::{models::interaction::SendInteractionDto, services::interaction::send_interaction};
#[tauri::command]
pub async fn send_interaction_cmd(dto: SendInteractionDto) -> Result<(), String> {

View File

@@ -149,9 +149,9 @@ async fn init_cursor_tracking() -> Result<(), String> {
// Update global state
if let Some(mutex) = LATEST_CURSOR_POSITION.get() {
if let Ok(mut guard) = mutex.lock() {
*guard = Some(raw.clone());
}
if let Ok(mut guard) = mutex.lock() {
*guard = Some(raw.clone());
}
}
let mapped = absolute_to_normalized(&raw);

View File

@@ -2,10 +2,7 @@ use serde_json::json;
use tracing::{error, info};
use crate::{
lock_r,
models::interaction::SendInteractionDto,
services::ws::WS_EVENT,
state::FDOLL,
lock_r, models::interaction::SendInteractionDto, services::ws::WS_EVENT, state::FDOLL,
};
pub async fn send_interaction(dto: SendInteractionDto) -> Result<(), String> {
@@ -49,7 +46,8 @@ pub async fn send_interaction(dto: SendInteractionDto) -> Result<(), String> {
// but we are in an async context. Ideally we spawn_blocking.
let spawn_result = tauri::async_runtime::spawn_blocking(move || {
socket.emit(WS_EVENT::CLIENT_SEND_INTERACTION, payload)
}).await;
})
.await;
match spawn_result {
Ok(emit_result) => match emit_result {

View File

@@ -379,7 +379,8 @@ fn on_interaction_received(payload: Payload, _socket: RawClient) {
match interaction_data {
Ok(data) => {
if let Err(e) = get_app_handle().emit(WS_EVENT::INTERACTION_RECEIVED, data) {
if let Err(e) = get_app_handle().emit(WS_EVENT::INTERACTION_RECEIVED, data)
{
error!("Failed to emit interaction-received event: {:?}", e);
}
}
@@ -399,14 +400,19 @@ fn on_interaction_delivery_failed(payload: Payload, _socket: RawClient) {
match payload {
Payload::Text(values) => {
if let Some(first_value) = values.first() {
info!("Received interaction-delivery-failed event: {:?}", first_value);
info!(
"Received interaction-delivery-failed event: {:?}",
first_value
);
let failure_data: Result<InteractionDeliveryFailedDto, _> =
serde_json::from_value(first_value.clone());
match failure_data {
Ok(data) => {
if let Err(e) = get_app_handle().emit(WS_EVENT::INTERACTION_DELIVERY_FAILED, data) {
if let Err(e) =
get_app_handle().emit(WS_EVENT::INTERACTION_DELIVERY_FAILED, data)
{
error!("Failed to emit interaction-delivery-failed event: {:?}", e);
}
}