Skip to content

Commit

Permalink
remove once_cell and replace with std::sync::LazyLock, increas MSRV
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Oct 24, 2024
1 parent 7f05bd4 commit 285e314
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT"
readme = "README.md"
repository = "https://github.com/rustic-rs/rustic"
resolver = "2"
rust-version = "1.76.0"
rust-version = "1.80.0"
description = """
rustic - fast, encrypted, deduplicated backups powered by Rust
"""
Expand Down Expand Up @@ -74,14 +74,14 @@ thiserror = "1"
# serialization
serde = { version = "1", features = ["serde_derive"] }
serde_json = "1"
serde_with = { version = "3.10", features = ["base64"] }
serde_with = { version = "3", features = ["base64"] }

# other dependencies
aho-corasick = "1.1.3"
aho-corasick = "1"
chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] }
comfy-table = "7.1.1"
rhai = { version = "1.19", features = ["sync", "serde", "no_optimize", "no_module", "no_custom_syntax", "only_i64"] }
scopeguard = "1.2"
comfy-table = "7"
rhai = { version = "1", features = ["sync", "serde", "no_optimize", "no_module", "no_custom_syntax", "only_i64"] }
scopeguard = "1"
semver = { version = "1", optional = true }
simplelog = "0.12"

Expand All @@ -93,16 +93,15 @@ clap_complete = "4"
conflate = "0.2"
convert_case = "0.6.0"
dateparser = "0.2.1"
derive_more = { version = "1.0.0", features = ["debug"] }
derive_more = { version = "1", features = ["debug"] }
dialoguer = "0.11.0"
directories = "5"
gethostname = "0.5"
globset = "0.4.15"
human-panic = "2.0.1"
human-panic = "2"
humantime = "2"
indicatif = "0.17"
itertools = "0.13"
once_cell = "1.20"
open = "5.3.0"
self_update = { version = "0.39.0", default-features = false, optional = true, features = ["rustls", "archive-tar", "compression-flate2"] } # FIXME: Downgraded to 0.39.0 due to https://github.com/jaemk/self_update/issues/136
toml = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Please make sure, that you read the

## Minimum Rust version policy

This crate's minimum supported `rustc` version is `1.76.0`.
This crate's minimum supported `rustc` version is `1.80.0`.

The current policy is that the minimum Rust version required to use this crate
can be increased in minor version updates. For example, if `crate 1.0` requires
Expand Down
5 changes: 2 additions & 3 deletions tests/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
use std::{
io::{Read, Write},
path::PathBuf,
sync::LazyLock,
};

use once_cell::sync::Lazy;

use abscissa_core::testing::prelude::*;

use rustic_testing::{files_differ, get_temp_file, TestResult};
Expand All @@ -25,7 +24,7 @@ use rustic_testing::{files_differ, get_temp_file, TestResult};
/// the runner acquire a mutex when executing commands and inspecting
/// exit statuses, serializing what would otherwise be multithreaded
/// invocations as `cargo test` executes tests in parallel by default.
pub static LAZY_RUNNER: Lazy<CmdRunner> = Lazy::new(|| {
pub static LAZY_RUNNER: LazyLock<CmdRunner> = LazyLock::new(|| {
let mut runner = CmdRunner::new(env!("CARGO_BIN_EXE_rustic"));
runner.exclusive().capture_stdout();
runner
Expand Down
5 changes: 2 additions & 3 deletions tests/show-config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
use std::{
io::{Read, Write},
path::PathBuf,
sync::LazyLock,
};

use once_cell::sync::Lazy;

use abscissa_core::testing::prelude::*;

use rustic_testing::{files_differ, get_temp_file, TestResult};
Expand All @@ -25,7 +24,7 @@ use rustic_testing::{files_differ, get_temp_file, TestResult};
// the runner acquire a mutex when executing commands and inspecting
// exit statuses, serializing what would otherwise be multithreaded
// invocations as `cargo test` executes tests in parallel by default.
pub static LAZY_RUNNER: Lazy<CmdRunner> = Lazy::new(|| {
pub static LAZY_RUNNER: LazyLock<CmdRunner> = LazyLock::new(|| {
let mut runner = CmdRunner::new(env!("CARGO_BIN_EXE_rustic"));
runner.exclusive().capture_stdout();
runner
Expand Down

0 comments on commit 285e314

Please sign in to comment.