once_cell -> std

This commit is contained in:
seth 2024-03-30 03:04:32 -04:00
parent a41a84fd2d
commit 90387c5a3b
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
28 changed files with 157 additions and 153 deletions

View file

@ -2,7 +2,6 @@ use std::slice::Iter;
use enum_dispatch::enum_dispatch;
use eyre::Result;
use once_cell::sync::Lazy;
use poise::serenity_prelude::Message;
use regex::Regex;
@ -25,7 +24,7 @@ pub trait LogProvider {
async fn fetch(&self, content: &str) -> Result<String>;
}
fn get_first_capture(regex: &Lazy<Regex>, string: &str) -> Option<String> {
fn get_first_capture(regex: &Regex, string: &str) -> Option<String> {
regex
.captures_iter(string)
.find_map(|c| c.get(1).map(|c| c.as_str().to_string()))