mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-28 12:11:53 +01:00
Reformat project
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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() })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user