Skip to content

Commit 9c9d932

Browse files
committed
Remove dependency lazy_static
1 parent a7990a6 commit 9c9d932

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ authors = ["The Rust Project Developers"]
1313
[dependencies]
1414
color-eyre = "=0.6.3"
1515
eyre = "=0.6.12"
16-
lazy_static = "=1.5.0"
1716
serde = { version = "=1.0.218", features = ["derive"] }
1817
serde_json = "=1.0.140"
1918
comrak = { version = "=0.36.0", features = ["bon"] }

src/posts.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ use super::blogs::Manifest;
22
use eyre::eyre;
33
use regex::Regex;
44
use serde::{Deserialize, Serialize};
5-
use std::path::{Path, PathBuf};
5+
use std::{
6+
path::{Path, PathBuf},
7+
sync::LazyLock,
8+
};
69

710
#[derive(Debug, PartialEq, Deserialize)]
811
struct TomlHeader {
@@ -113,9 +116,8 @@ impl Post {
113116

114117
// If they supplied team, it should look like `team-text <team-url>`
115118
let (team, team_url) = team_string.map_or((None, None), |s| {
116-
lazy_static::lazy_static! {
117-
static ref R: Regex = Regex::new(r"(?P<name>[^<]*) <(?P<url>[^>]+)>").unwrap();
118-
}
119+
static R: LazyLock<Regex> =
120+
LazyLock::new(|| Regex::new(r"(?P<name>[^<]*) <(?P<url>[^>]+)>").unwrap());
119121
let Some(captures) = R.captures(&s) else {
120122
panic!(
121123
"team from path `{}` should have format `$name <$url>`",

0 commit comments

Comments
 (0)