mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-09-11 07:55:34 +03:00
chore: fix clippy warnings, remove license template
The license template has been removed from rustfmt nightly :(
This commit is contained in:
parent
9d33d09341
commit
23a049c593
2
.github/workflows/lint-fmt-cli.yml
vendored
2
.github/workflows/lint-fmt-cli.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
|
2
.github/workflows/lint-fmt-core.yml
vendored
2
.github/workflows/lint-fmt-core.yml
vendored
@ -34,7 +34,7 @@ jobs:
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
|
2
.github/workflows/test-bundler.yml
vendored
2
.github/workflows/test-bundler.yml
vendored
@ -92,7 +92,7 @@ jobs:
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -100,6 +100,8 @@ use std::{
|
||||
};
|
||||
|
||||
pub type WebviewId = u64;
|
||||
type IpcHandler = dyn Fn(&Window, String) + 'static;
|
||||
type FileDropHandler = dyn Fn(&Window, WryFileDropEvent) -> bool + 'static;
|
||||
|
||||
mod webview;
|
||||
pub use webview::Webview;
|
||||
@ -3067,7 +3069,7 @@ fn create_ipc_handler<T: UserEvent>(
|
||||
menu_ids: Arc<Mutex<HashMap<MenuHash, MenuId>>>,
|
||||
js_event_listeners: Arc<Mutex<HashMap<JsEventListenerKey, HashSet<u64>>>>,
|
||||
handler: WebviewIpcHandler<T, Wry<T>>,
|
||||
) -> Box<dyn Fn(&Window, String) + 'static> {
|
||||
) -> Box<IpcHandler> {
|
||||
Box::new(move |window, request| {
|
||||
let window_id = context.webview_id_map.get(&window.id());
|
||||
handler(
|
||||
@ -3086,9 +3088,7 @@ fn create_ipc_handler<T: UserEvent>(
|
||||
}
|
||||
|
||||
/// Create a wry file drop handler.
|
||||
fn create_file_drop_handler<T: UserEvent>(
|
||||
context: &Context<T>,
|
||||
) -> Box<dyn Fn(&Window, WryFileDropEvent) -> bool + 'static> {
|
||||
fn create_file_drop_handler<T: UserEvent>(context: &Context<T>) -> Box<FileDropHandler> {
|
||||
let window_event_listeners = context.window_event_listeners.clone();
|
||||
let webview_id_map = context.webview_id_map.clone();
|
||||
Box::new(move |window, event| {
|
||||
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -25,7 +25,6 @@ use tauri_utils::{
|
||||
html::{SCRIPT_NONCE_TOKEN, STYLE_NONCE_TOKEN},
|
||||
};
|
||||
|
||||
use crate::app::{GlobalMenuEventListener, WindowMenuEvent};
|
||||
use crate::hooks::IpcJavascript;
|
||||
#[cfg(feature = "isolation")]
|
||||
use crate::hooks::IsolationJavascript;
|
||||
@ -51,6 +50,10 @@ use crate::{
|
||||
Context, EventLoopMessage, Icon, Invoke, Manager, Pattern, Runtime, Scopes, StateManager, Window,
|
||||
WindowEvent,
|
||||
};
|
||||
use crate::{
|
||||
app::{GlobalMenuEventListener, WindowMenuEvent},
|
||||
window::WebResourceRequestHandler,
|
||||
};
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
use crate::api::path::{resolve_path, BaseDirectory};
|
||||
@ -390,9 +393,7 @@ impl<R: Runtime> WindowManager<R> {
|
||||
label: &str,
|
||||
window_labels: &[String],
|
||||
app_handle: AppHandle<R>,
|
||||
web_resource_request_handler: Option<
|
||||
Box<dyn Fn(&HttpRequest, &mut HttpResponse) + Send + Sync>,
|
||||
>,
|
||||
web_resource_request_handler: Option<Box<WebResourceRequestHandler>>,
|
||||
) -> crate::Result<PendingWindow<EventLoopMessage, R>> {
|
||||
let is_init_global = self.inner.config.build.with_global_tauri;
|
||||
let plugin_init = self
|
||||
@ -1045,9 +1046,7 @@ impl<R: Runtime> WindowManager<R> {
|
||||
app_handle: AppHandle<R>,
|
||||
mut pending: PendingWindow<EventLoopMessage, R>,
|
||||
window_labels: &[String],
|
||||
web_resource_request_handler: Option<
|
||||
Box<dyn Fn(&HttpRequest, &mut HttpResponse) + Send + Sync>,
|
||||
>,
|
||||
web_resource_request_handler: Option<Box<WebResourceRequestHandler>>,
|
||||
) -> crate::Result<PendingWindow<EventLoopMessage, R>> {
|
||||
if self.windows_lock().contains_key(&pending.label) {
|
||||
return Err(crate::Error::WindowLabelAlreadyExists(pending.label));
|
||||
|
@ -46,6 +46,8 @@ use std::{
|
||||
process::{exit, Command},
|
||||
};
|
||||
|
||||
type ShouldInstall = dyn FnOnce(&Version, &RemoteRelease) -> bool + Send;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum RemoteReleaseInner {
|
||||
@ -209,7 +211,7 @@ pub struct UpdateBuilder<R: Runtime> {
|
||||
pub target: Option<String>,
|
||||
/// The current executable path. Default is automatically extracted.
|
||||
pub executable_path: Option<PathBuf>,
|
||||
should_install: Option<Box<dyn FnOnce(&Version, &RemoteRelease) -> bool + Send>>,
|
||||
should_install: Option<Box<ShouldInstall>>,
|
||||
timeout: Option<Duration>,
|
||||
headers: HeaderMap,
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
pub(crate) type WebResourceRequestHandler = dyn Fn(&HttpRequest, &mut HttpResponse) + Send + Sync;
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
struct WindowCreatedEvent {
|
||||
label: String,
|
||||
@ -103,7 +105,7 @@ pub struct WindowBuilder<'a, R: Runtime> {
|
||||
label: String,
|
||||
pub(crate) window_builder: <R::Dispatcher as Dispatch<EventLoopMessage>>::WindowBuilder,
|
||||
pub(crate) webview_attributes: WebviewAttributes,
|
||||
web_resource_request_handler: Option<Box<dyn Fn(&HttpRequest, &mut HttpResponse) + Send + Sync>>,
|
||||
web_resource_request_handler: Option<Box<WebResourceRequestHandler>>,
|
||||
}
|
||||
|
||||
impl<'a, R: Runtime> fmt::Debug for WindowBuilder<'a, R> {
|
||||
|
@ -1 +0,0 @@
|
||||
../../../../.license_template
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -14,4 +14,3 @@ force_explicit_abi = true
|
||||
# normalize_comments = true
|
||||
normalize_doc_attributes = true
|
||||
# wrap_comments = true
|
||||
license_template_path = ".license_template"
|
||||
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
@ -18,11 +18,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install rustfmt with nightly toolchain
|
||||
- name: Install rustfmt with stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
- uses: actions-rs/cargo@v1
|
||||
|
@ -1 +0,0 @@
|
||||
{{ license_template }}
|
@ -18,11 +18,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install rustfmt with nightly toolchain
|
||||
- name: Install rustfmt with stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
- uses: actions-rs/cargo@v1
|
||||
|
@ -1 +0,0 @@
|
||||
{{ license_template }}
|
@ -1,3 +0,0 @@
|
||||
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
Loading…
Reference in New Issue
Block a user