mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-29 04:55:40 +03:00
fix(core): compilation issues without execute or sidecar features (#6621)
This commit is contained in:
parent
09d5dd520f
commit
a813792786
5
.changes/fix-shell-build.md
Normal file
5
.changes/fix-shell-build.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Fix compilation issues without the shell API features.
|
@ -5,13 +5,9 @@
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use super::InvokeContext;
|
||||
use crate::{
|
||||
api::{
|
||||
ipc::CallbackFn,
|
||||
process::{CommandEvent, TerminatedPayload},
|
||||
},
|
||||
Runtime,
|
||||
};
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
use crate::api::process::{CommandEvent, TerminatedPayload};
|
||||
use crate::{api::ipc::CallbackFn, Runtime};
|
||||
#[cfg(shell_scope)]
|
||||
use crate::{Manager, Scopes};
|
||||
use encoding_rs::Encoding;
|
||||
@ -38,6 +34,7 @@ fn command_child_store() -> &'static ChildStore {
|
||||
&STORE
|
||||
}
|
||||
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
#[serde(tag = "event", content = "payload")]
|
||||
#[non_exhaustive]
|
||||
@ -52,6 +49,7 @@ enum JSCommandEvent {
|
||||
Terminated(TerminatedPayload),
|
||||
}
|
||||
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
fn get_event_buffer(line: Vec<u8>, encoding: EncodingWrapper) -> Result<Buffer, FromUtf8Error> {
|
||||
match encoding {
|
||||
EncodingWrapper::Text(character_encoding) => match character_encoding {
|
||||
@ -64,6 +62,7 @@ fn get_event_buffer(line: Vec<u8>, encoding: EncodingWrapper) -> Result<Buffer,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
impl JSCommandEvent {
|
||||
pub fn new(event: CommandEvent, encoding: EncodingWrapper) -> Self {
|
||||
match event {
|
||||
@ -87,6 +86,7 @@ pub enum Buffer {
|
||||
Raw(Vec<u8>),
|
||||
}
|
||||
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum EncodingWrapper {
|
||||
Raw,
|
||||
|
Loading…
Reference in New Issue
Block a user