Skip to content

Commit 6acca19

Browse files
authored
Merge pull request #1861 from GitoxideLabs/revert-lazylock
use MSRV more consistently
2 parents 8776a3e + 147eb41 commit 6acca19

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ authors = ["Sebastian Thiel <[email protected]>"]
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
version = "0.41.0"
11+
rust-version = "1.74"
1112
default-run = "gix"
1213
include = ["src/**/*", "/build.rs", "LICENSE-*", "README.md"]
1314
resolver = "2"

src/shared.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ mod clap {
327327
#[derive(Clone)]
328328
pub struct AsPathSpec;
329329

330-
static PATHSPEC_DEFAULTS: std::sync::LazyLock<gix::pathspec::Defaults> = std::sync::LazyLock::new(|| {
330+
static PATHSPEC_DEFAULTS: once_cell::sync::Lazy<gix::pathspec::Defaults> = once_cell::sync::Lazy::new(|| {
331331
gix::pathspec::Defaults::from_environment(&mut |n| std::env::var_os(n)).unwrap_or_default()
332332
});
333333

tests/it/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ authors = ["Sebastian Thiel <[email protected]>"]
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
publish = false
11+
rust-version = "1.74.0"
1112

1213
[[bin]]
1314
name = "it"

tests/it/src/commands/check_mode.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub(super) mod function {
22
use anyhow::{bail, Context};
33
use gix::bstr::ByteSlice;
4-
4+
use once_cell::sync::Lazy;
55
use regex::bytes::Regex;
66
use std::ffi::{OsStr, OsString};
77
use std::io::{BufRead, BufReader, Read};
@@ -66,7 +66,7 @@ pub(super) mod function {
6666

6767
/// On mismatch, report it and return `Some(true)`.
6868
fn check_for_mismatch(root: &OsStr, record: &[u8]) -> anyhow::Result<bool> {
69-
static RECORD_REGEX: std::sync::LazyLock<Regex> = std::sync::LazyLock::new(|| {
69+
static RECORD_REGEX: Lazy<Regex> = Lazy::new(|| {
7070
let pattern = r"(?-u)\A([0-7]+) ([[:xdigit:]]+) [[:digit:]]+\t(.+)\z";
7171
Regex::new(pattern).expect("regex should be valid")
7272
});

0 commit comments

Comments
 (0)