Skip to content

Commit a9dfc01

Browse files
authored
feat: update to edition 2021 and set minimum rust to 1.56 (tauri-apps#2789)
1 parent 80ffa87 commit a9dfc01

File tree

71 files changed

+229
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+229
-132
lines changed

.changes/rust-1.56.0.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"tauri": patch
3+
"cli.rs": patch
4+
"tauri-bundler": patch
5+
"tauri-utils": patch
6+
"tauri-macros": patch
7+
"tauri-codegen": patch
8+
"tauri-runtime": patch
9+
"tauri-runtime-wry": patch
10+
"tauri-driver": patch
11+
"tauri-build": patch
12+
---
13+
14+
The minimum Rust version is now `1.56`.

.github/workflows/test-core.yml

+5
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ jobs:
158158

159159
steps:
160160
- uses: actions/checkout@v2
161+
- name: install stable
162+
uses: actions-rs/toolchain@v1
163+
with:
164+
toolchain: stable
165+
override: true
161166
- name: install webkit2gtk (ubuntu only)
162167
if: matrix.platform == 'ubuntu-latest'
163168
run: |

core/tauri-build/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ license = "Apache-2.0 OR MIT"
77
homepage = "https://tauri.studio"
88
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build"
99
description = "build time code to pair with https://crates.io/crates/tauri"
10-
edition = "2018"
10+
edition = "2021"
11+
rust-version = "1.56"
1112
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
1213
readme = "README.md"
1314

core/tauri-codegen/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ license = "Apache-2.0 OR MIT"
77
homepage = "https://tauri.studio"
88
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen"
99
description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`"
10-
edition = "2018"
10+
edition = "2021"
11+
rust-version = "1.56"
1112
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
1213
readme = "README.md"
1314

core/tauri-macros/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ license = "Apache-2.0 OR MIT"
77
homepage = "https://tauri.studio"
88
repository = "https://github.com/tauri-apps/tauri"
99
description = "Macros for the tauri crate."
10-
edition = "2018"
10+
edition = "2021"
11+
rust-version = "1.56"
1112
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
1213
readme = "README.md"
1314

core/tauri-macros/src/command/handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct Handler {
1616
}
1717

1818
impl Parse for Handler {
19-
fn parse(input: &ParseBuffer) -> syn::Result<Self> {
19+
fn parse(input: &ParseBuffer<'_>) -> syn::Result<Self> {
2020
let paths = input.parse_terminated::<Path, Token![,]>(Path::parse)?;
2121

2222
// parse the command names and wrappers from the passed paths

core/tauri-macros/src/command/wrapper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ enum ExecutionContext {
1919
}
2020

2121
impl Parse for ExecutionContext {
22-
fn parse(input: &ParseBuffer) -> syn::Result<Self> {
22+
fn parse(input: &ParseBuffer<'_>) -> syn::Result<Self> {
2323
if input.is_empty() {
2424
return Ok(Self::Blocking);
2525
}

core/tauri-macros/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(crate) struct ContextItems {
1818
}
1919

2020
impl Parse for ContextItems {
21-
fn parse(input: &ParseBuffer) -> syn::parse::Result<Self> {
21+
fn parse(input: &ParseBuffer<'_>) -> syn::parse::Result<Self> {
2222
let config_file = if input.is_empty() {
2323
std::env::var("CARGO_MANIFEST_DIR").map(|m| PathBuf::from(m).join("tauri.conf.json"))
2424
} else {

core/tauri-macros/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// SPDX-License-Identifier: MIT
44

5-
extern crate proc_macro;
65
use crate::context::ContextItems;
76
use proc_macro::TokenStream;
87
use syn::{parse_macro_input, DeriveInput};

core/tauri-macros/src/runtime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) struct Attributes {
1414
}
1515

1616
impl Parse for Attributes {
17-
fn parse(input: ParseStream) -> syn::Result<Self> {
17+
fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
1818
let default_type = input.parse()?;
1919
input.parse::<Token![,]>()?;
2020
Ok(Attributes {

core/tauri-runtime-wry/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ license = "Apache-2.0 OR MIT"
77
homepage = "https://tauri.studio"
88
repository = "https://github.com/tauri-apps/tauri"
99
description = "Wry bindings to the Tauri runtime"
10-
edition = "2018"
10+
edition = "2021"
11+
rust-version = "1.56"
1112
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
1213
readme = "README.md"
1314

core/tauri-runtime-wry/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ use std::{
8989
hash_map::Entry::{Occupied, Vacant},
9090
HashMap,
9191
},
92-
convert::TryFrom,
9392
fmt,
9493
fs::read,
9594
ops::Deref,
@@ -534,7 +533,7 @@ impl TryFrom<Icon> for WryIcon {
534533
struct WindowEventWrapper(Option<WindowEvent>);
535534

536535
impl WindowEventWrapper {
537-
fn parse(webview: &WindowHandle, event: &WryWindowEvent) -> Self {
536+
fn parse(webview: &WindowHandle, event: &WryWindowEvent<'_>) -> Self {
538537
match event {
539538
// resized event from tao doesn't include a reliable size on macOS
540539
// because wry replaces the NSView
@@ -2214,7 +2213,7 @@ fn handle_user_message(
22142213
}
22152214

22162215
fn handle_event_loop(
2217-
event: Event<Message>,
2216+
event: Event<'_, Message>,
22182217
event_loop: &EventLoopWindowTarget<Message>,
22192218
control_flow: &mut ControlFlow,
22202219
context: EventLoopIterationContext<'_>,

core/tauri-runtime/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ license = "Apache-2.0 OR MIT"
77
homepage = "https://tauri.studio"
88
repository = "https://github.com/tauri-apps/tauri"
99
description = "Runtime for Tauri applications"
10-
edition = "2018"
10+
edition = "2021"
11+
rust-version = "1.56"
1112
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
1213
readme = "README.md"
1314

core/tauri-runtime/src/http/mime_type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum MimeType {
2222
}
2323

2424
impl std::fmt::Display for MimeType {
25-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
25+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2626
let mime = match self {
2727
MimeType::Css => "text/css",
2828
MimeType::Csv => "text/csv",

core/tauri-runtime/src/http/response.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use super::{
77
status::StatusCode,
88
version::Version,
99
};
10-
use std::{convert::TryFrom, fmt};
10+
use std::fmt;
1111

1212
type Result<T> = core::result::Result<T, Box<dyn std::error::Error>>;
1313

core/tauri-utils/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ license = "Apache-2.0 OR MIT"
66
homepage = "https://tauri.studio"
77
repository = "https://github.com/tauri-apps/tauri"
88
description = "Utilities for Tauri"
9-
edition = "2018"
9+
edition = "2021"
10+
rust-version = "1.56"
1011
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
1112
readme = "README.md"
1213

core/tauri/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ license = "Apache-2.0 OR MIT"
77
homepage = "https://tauri.studio"
88
repository = "https://github.com/tauri-apps/tauri"
99
description = "Make tiny, secure apps for all desktop platforms with Tauri"
10-
edition = "2018"
10+
edition = "2021"
11+
rust-version = "1.56"
1112
exclude = [
1213
"/test",
1314
"/.scripts",

docs/usage/guides/webdriver/example/setup.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ to the Cargo Manifest (`Cargo.toml`) so that Cargo knows to pull in our dependen
7171
[package]
7272
name = "hello-tauri-webdriver"
7373
version = "0.1.0"
74-
edition = "2018"
74+
edition = "2021"
75+
rust-version = "1.56"
7576

7677
# Needed to set up some things for Tauri at build time
7778
[build-dependencies]

0 commit comments

Comments
 (0)