Reformat project

This commit is contained in:
Gregory Schier
2025-12-13 08:10:12 -08:00
parent c20c0eff32
commit cfbfd66eef
68 changed files with 290 additions and 759 deletions

View File

@@ -128,9 +128,7 @@ pub(crate) async fn send<R: Runtime>(
&PluginContext::new(&window),
RenderPurpose::Send,
),
&RenderOptions {
error_behavior: RenderErrorBehavior::Throw,
},
&RenderOptions { error_behavior: RenderErrorBehavior::Throw },
)
.await?;
@@ -164,10 +162,7 @@ pub(crate) async fn close<R: Runtime>(
let db = app_handle.db();
let connection = db.get_websocket_connection(connection_id)?;
db.upsert_websocket_connection(
&WebsocketConnection {
state: WebsocketConnectionState::Closing,
..connection
},
&WebsocketConnection { state: WebsocketConnectionState::Closing, ..connection },
&UpdateSource::from_window(&window),
)?
};
@@ -208,9 +203,7 @@ pub(crate) async fn connect<R: Runtime>(
&PluginContext::new(&window),
RenderPurpose::Send,
),
&RenderOptions {
error_behavior: RenderErrorBehavior::Throw,
},
&RenderOptions { error_behavior: RenderErrorBehavior::Throw },
)
.await?;
@@ -278,10 +271,7 @@ pub(crate) async fn connect<R: Runtime>(
.headers
.clone()
.into_iter()
.map(|h| HttpHeader {
name: h.name,
value: h.value,
})
.map(|h| HttpHeader { name: h.name, value: h.value })
.collect(),
};
let plugin_result = plugin_manager

View File

@@ -11,7 +11,7 @@ use crate::commands::{
};
use crate::manager::WebsocketManager;
use tauri::plugin::{Builder, TauriPlugin};
use tauri::{generate_handler, Manager, Runtime};
use tauri::{Manager, Runtime, generate_handler};
use tokio::sync::Mutex;
pub fn init<R: Runtime>() -> TauriPlugin<R> {

View File

@@ -23,10 +23,7 @@ pub struct WebsocketManager {
impl WebsocketManager {
pub fn new() -> Self {
WebsocketManager {
connections: Default::default(),
read_tasks: Default::default(),
}
WebsocketManager { connections: Default::default(), read_tasks: Default::default() }
}
pub async fn connect(

View File

@@ -70,12 +70,5 @@ pub async fn render_websocket_request<T: TemplateCallback>(
let message = parse_and_render(&r.message.clone(), vars, cb, opt).await?;
Ok(WebsocketRequest {
url,
url_parameters,
headers,
authentication,
message,
..r.to_owned()
})
Ok(WebsocketRequest { url, url_parameters, headers, authentication, message, ..r.to_owned() })
}