Skip to content

Commit

Permalink
Bump MSRV to 1.80
Browse files Browse the repository at this point in the history
  • Loading branch information
photino committed Sep 10, 2024
1 parent 64db7d1 commit abeb0f3
Show file tree
Hide file tree
Showing 25 changed files with 67 additions and 66 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ which emphasizes **simplicity**, **extensibility** and **productivity**.
## Getting started

You can start with the example [`actix-app`], [`axum-app`], [`dioxus-desktop`] or [`ntex-app`].
It requires **Rust 1.75+** to build the project.
It requires **Rust 1.80+** to build the project.

```shell
cd examples/axum-app
Expand Down
10 changes: 5 additions & 5 deletions examples/actix-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "actix-app"
description = "An example for actix-web integration."
version = "0.8.2"
version = "0.9.0"
rust-version = "1.75"
edition = "2021"
publish = false
Expand All @@ -19,7 +19,7 @@ features = ["derive"]

[dependencies.zino]
path = "../../zino"
version = "0.24.3"
version = "0.25.0"
features = [
"actix",
"i18n",
Expand All @@ -30,7 +30,7 @@ features = [

[dependencies.zino-core]
path = "../../zino-core"
version = "0.25.3"
version = "0.26.0"
features = [
"cookie",
"env-filter",
Expand All @@ -40,8 +40,8 @@ features = [

[dependencies.zino-derive]
path = "../../zino-derive"
version = "0.22.3"
version = "0.23.0"

[dependencies.zino-model]
path = "../../zino-model"
version = "0.22.3"
version = "0.23.0"
12 changes: 6 additions & 6 deletions examples/axum-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "axum-app"
description = "An example for axum integration."
version = "0.14.2"
rust-version = "1.75"
version = "0.15.0"
rust-version = "1.80"
edition = "2021"
publish = false

Expand All @@ -19,7 +19,7 @@ features = ["derive"]

[dependencies.zino]
path = "../../zino"
version = "0.24.3"
version = "0.25.0"
features = [
"axum",
"i18n",
Expand All @@ -29,7 +29,7 @@ features = [

[dependencies.zino-core]
path = "../../zino-core"
version = "0.25.3"
version = "0.26.0"
features = [
"cookie",
"env-filter",
Expand All @@ -40,8 +40,8 @@ features = [

[dependencies.zino-derive]
path = "../../zino-derive"
version = "0.22.3"
version = "0.23.0"

[dependencies.zino-model]
path = "../../zino-model"
version = "0.22.3"
version = "0.23.0"
10 changes: 5 additions & 5 deletions examples/dioxus-desktop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "dioxus-desktop"
description = "An example for Dioxus desktop integration."
version = "0.5.4"
rust-version = "1.75"
version = "0.6.0"
rust-version = "1.80"
edition = "2021"
publish = false

Expand All @@ -22,14 +22,14 @@ features = [

[dependencies.zino]
path = "../../zino"
version = "0.24.3"
version = "0.25.0"
features = ["dioxus-desktop"]

[dependencies.zino-core]
path = "../../zino-core"
version = "0.25.3"
version = "0.26.0"
features = ["env-filter", "tls-native"]

[dependencies.zino-dioxus]
path = "../../zino-dioxus"
version = "0.7.3"
version = "0.8.0"
6 changes: 3 additions & 3 deletions examples/minimal-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "minimal-app"
description = "A minimal example to run a server."
version = "0.3.2"
rust-version = "1.75"
version = "0.4.0"
rust-version = "1.80"
edition = "2021"
publish = false

[dependencies.zino]
path = "../../zino"
version = "0.24.3"
version = "0.25.0"
features = ["axum"]

12 changes: 6 additions & 6 deletions examples/ntex-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "ntex-app"
description = "An example for ntex integration."
version = "0.2.4"
rust-version = "1.76"
version = "0.3.0"
rust-version = "1.80"
edition = "2021"
publish = false

Expand All @@ -19,7 +19,7 @@ features = ["derive"]

[dependencies.zino]
path = "../../zino"
version = "0.24.3"
version = "0.25.0"
features = [
"i18n",
"jwt",
Expand All @@ -29,7 +29,7 @@ features = [

[dependencies.zino-core]
path = "../../zino-core"
version = "0.25.3"
version = "0.26.0"
features = [
"cookie",
"env-filter",
Expand All @@ -39,8 +39,8 @@ features = [

[dependencies.zino-derive]
path = "../../zino-derive"
version = "0.22.3"
version = "0.23.0"

[dependencies.zino-model]
path = "../../zino-model"
version = "0.22.3"
version = "0.23.0"
2 changes: 1 addition & 1 deletion zino-chart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "zino-chart"
description = "Data visualizations for zino."
version = "0.0.1"
rust-version = "1.75"
rust-version = "1.80"
edition = "2021"
license = "MIT"
categories = ["visualization"]
Expand Down
6 changes: 3 additions & 3 deletions zino-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "zino-cli"
description = "CLI tools for zino."
version = "0.4.0"
rust-version = "1.75"
rust-version = "1.80"
edition = "2021"
license = "MIT"
categories = ["command-line-utilities", "network-programming", "web-programming"]
Expand Down Expand Up @@ -40,9 +40,9 @@ features = ["derive"]

[dependencies.zino]
path = "../zino"
version = "0.24.2"
version = "0.25.0"
features = ["axum"]

[dependencies.zino-core]
path = "../zino-core"
version = "0.25.2"
version = "0.26.0"
3 changes: 1 addition & 2 deletions zino-cli/src/cli/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl New {
.map(|_| {
log::info!("project `{}` created successfully", self.project_name);
})
.map_err(|err| {
.inspect_err(|_err| {
if !project_dir_already_exists && Path::new("./Cargo.toml").is_dir() {
if let Err(err) = fs::remove_dir_all(&self.project_name) {
log::warn!(
Expand All @@ -37,7 +37,6 @@ impl New {
);
}
}
err
})
}

Expand Down
5 changes: 2 additions & 3 deletions zino-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "zino-core"
description = "Core types and traits for zino."
version = "0.25.3"
rust-version = "1.75"
version = "0.26.0"
rust-version = "1.80"
edition = "2021"
license = "MIT"
categories = ["asynchronous", "network-programming", "web-programming::http-server"]
Expand Down Expand Up @@ -207,7 +207,6 @@ http = "1.1.0"
md-5 = "0.10.6"
mime_guess = "2.0.5"
multer = "3.1.0"
once_cell = "1.19.0"
parking_lot = "0.12.3"
percent-encoding = "2.3.1"
rand = "0.8.5"
Expand Down
10 changes: 5 additions & 5 deletions zino-core/src/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub trait Application {
// Initializes the directories to ensure that they are ready for use
for path in SHARED_DIRS.values() {
if !path.exists() {
if let Err(err) = fs::create_dir_all(&path) {
if let Err(err) = fs::create_dir_all(path) {
let path = path.display();
tracing::error!("fail to create the directory {path}: {err}");
}
Expand Down Expand Up @@ -197,7 +197,7 @@ pub trait Application {
/// Returns a reference to the shared application state.
#[inline]
fn shared_state() -> &'static State<Map> {
LazyLock::force(&SHARED_APP_STATE)
&SHARED_APP_STATE
}

/// Returns the application env.
Expand Down Expand Up @@ -250,7 +250,7 @@ pub trait Application {
/// Returns the project directory for the application.
#[inline]
fn project_dir() -> &'static PathBuf {
LazyLock::force(&PROJECT_DIR)
&PROJECT_DIR
}

/// Returns the config directory for the application.
Expand All @@ -261,7 +261,7 @@ pub trait Application {
/// It can also be specified by the environment variable `ZINO_APP_CONFIG_DIR`.
#[inline]
fn config_dir() -> &'static PathBuf {
LazyLock::force(&CONFIG_DIR)
&CONFIG_DIR
}

/// Returns the shared directory with a specific name,
Expand All @@ -279,7 +279,7 @@ pub trait Application {
fn shared_dir(name: &str) -> Cow<'_, PathBuf> {
SHARED_DIRS
.get(name)
.map(|path| Cow::Borrowed(path))
.map(Cow::Borrowed)
.unwrap_or_else(|| Cow::Owned(Self::parse_path(name)))
}

Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/auth/jwt_claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl JwtClaims<()> {
/// Returns the shared secret access key for the HMAC algorithm.
#[inline]
pub fn shared_key() -> &'static JwtHmacKey {
LazyLock::force(&SECRET_KEY)
&SECRET_KEY
}
}

Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/auth/rego_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl RegoEngine {
/// Returns a reference to the shared Rego engine.
#[inline]
pub fn shared() -> &'static Self {
LazyLock::force(&SHARED_REGO_ENGINE)
&SHARED_REGO_ENGINE
}
}

Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/channel/flume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl MessageChannel {
/// Returns a reference to the shared message channel.
#[inline]
pub fn shared() -> &'static Self {
LazyLock::force(&SHARED_CHANNEL)
&SHARED_CHANNEL
}

/// Get the number of subscribers that currently exist.
Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub type Uuid = uuid::Uuid;
pub type Decimal = rust_decimal::Decimal;

/// A value which is initialized on the first access.
pub type LazyLock<T> = once_cell::sync::Lazy<T>;
pub type LazyLock<T> = std::sync::LazyLock<T>;

/// An allocation-optimized string.
pub type SharedString = std::borrow::Cow<'static, str>;
Expand Down
5 changes: 4 additions & 1 deletion zino-core/src/orm/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ impl<'a> ColumnExt for Column<'a> {
} else if column_type.starts_with("TIMESTAMP") {
data_type.starts_with("TIMESTAMP")
} else if column_type.starts_with("VARCHAR") {
matches!(data_type.as_str(), "TEXT" | "VARCHAR" | "CHARACTER VARYING")
matches!(
data_type.as_str(),
"TEXT" | "VARCHAR" | "CHARACTER VARYING" | "ENUM"
)
} else {
false
}
Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl State {
/// Returns a reference to the shared state.
#[inline]
pub fn shared() -> &'static Self {
LazyLock::force(&SHARED_STATE)
&SHARED_STATE
}

/// Encrypts the password in the config.
Expand Down
6 changes: 3 additions & 3 deletions zino-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "zino-derive"
description = "Derived traits for zino."
version = "0.22.3"
rust-version = "1.75"
version = "0.23.0"
rust-version = "1.80"
edition = "2021"
license = "MIT"
homepage = "https://github.com/zino-rs/zino"
Expand All @@ -21,5 +21,5 @@ syn = "2.0.77"

[dependencies.zino-core]
path = "../zino-core"
version = "0.25.3"
version = "0.26.0"
features = ["orm"]
6 changes: 3 additions & 3 deletions zino-dioxus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "zino-dioxus"
description = "Dioxus components for zino."
version = "0.7.3"
rust-version = "1.75"
version = "0.8.0"
rust-version = "1.80"
edition = "2021"
license = "MIT"
categories = ["gui", "network-programming", "web-programming"]
Expand Down Expand Up @@ -56,4 +56,4 @@ features = [

[dependencies.zino-core]
path = "../zino-core"
version = "0.25.3"
version = "0.26.0"
6 changes: 3 additions & 3 deletions zino-extra/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "zino-extra"
description = "Extra utilities for zino."
version = "0.4.2"
rust-version = "1.75"
version = "0.5.0"
rust-version = "1.80"
edition = "2021"
license = "MIT"
categories = ["asynchronous", "network-programming", "web-programming"]
Expand Down Expand Up @@ -39,4 +39,4 @@ optional = true

[dependencies.zino-core]
path = "../zino-core"
version = "0.25.3"
version = "0.26.0"
Loading

0 comments on commit abeb0f3

Please sign in to comment.