Skip to content

Commit

Permalink
Use std::sync::LazyLock instead of once_cell::sync::Lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
noritada committed Oct 24, 2024
1 parent a9b73ce commit 6ed8511
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repository.workspace = true
homepage.workspace = true
categories.workspace = true
keywords.workspace = true
rust-version = "1.80"

[[bin]]
name = "gribber"
Expand All @@ -23,7 +24,6 @@ chrono = "0.4.23"
clap = "4.1"
clap_complete = "4"
console = "0.15"
once_cell = "1.13"
regex = "1.6"

[target.'cfg(unix)'.dependencies]
Expand Down
5 changes: 2 additions & 3 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{fs::File, io::BufReader, path::Path};
use std::{fs::File, io::BufReader, path::Path, sync::LazyLock};

use grib::{Grib2, SeekableGrib2Reader};
use once_cell::sync::Lazy;
#[cfg(unix)]
use pager::Pager;
use regex::Regex;
Expand Down Expand Up @@ -63,7 +62,7 @@ impl std::str::FromStr for CliMessageIndex {
type Err = anyhow::Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
static RE: Lazy<Regex> = Lazy::new(|| {
static RE: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(
r"(?x) # insignificant whitespace mode
^
Expand Down

0 comments on commit 6ed8511

Please sign in to comment.