1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-01-18 22:01:50 +01:00

Use once_cell instead of lazy_static (#2029)

This commit is contained in:
fboulnois 2021-02-27 16:55:50 -05:00 committed by GitHub
parent ebda60fd6b
commit 1f34718ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -66,7 +66,7 @@ http = "0.2.2"
httparse = "1.3"
itoa = "0.4"
language-tags = "0.2"
lazy_static = "1.4"
once_cell = "1.5"
log = "0.4"
mime = "0.3"
percent-encoding = "2.1"

View File

@ -6,7 +6,7 @@
//! Browser conformance tests at: http://greenbytes.de/tech/tc2231/
//! IANA assignment: http://www.iana.org/assignments/cont-disp/cont-disp.xhtml
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use regex::Regex;
use std::fmt::{self, Write};
@ -520,9 +520,7 @@ impl fmt::Display for DispositionParam {
//
//
// See also comments in test_from_raw_unnecessary_percent_decode.
lazy_static! {
static ref RE: Regex = Regex::new("[\x00-\x08\x10-\x1F\x7F\"\\\\]").unwrap();
}
static RE: Lazy<Regex> = Lazy::new(|| Regex::new("[\x00-\x08\x10-\x1F\x7F\"\\\\]").unwrap());
match self {
DispositionParam::Name(ref value) => write!(f, "name={}", value),
DispositionParam::Filename(ref value) => {