@@ -22327,11 +22327,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype0ParseVariant1ValueV
22327
22327
impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype0ParseVariant1ValueVariant1 {
22328
22328
type Err = self::error::ConversionError;
22329
22329
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22330
- if regress::Regex::new("^(date|utc):.*$")
22331
- .unwrap()
22332
- .find(value)
22333
- .is_none()
22334
- {
22330
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
22331
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
22332
+ if (&*PATTERN).find(value).is_none() {
22335
22333
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
22336
22334
}
22337
22335
Ok(Self(value.to_string()))
@@ -22849,11 +22847,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype1ParseVariant1ValueV
22849
22847
impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype1ParseVariant1ValueVariant1 {
22850
22848
type Err = self::error::ConversionError;
22851
22849
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22852
- if regress::Regex::new("^(date|utc):.*$")
22853
- .unwrap()
22854
- .find(value)
22855
- .is_none()
22856
- {
22850
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
22851
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
22852
+ if (&*PATTERN).find(value).is_none() {
22857
22853
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
22858
22854
}
22859
22855
Ok(Self(value.to_string()))
@@ -23430,11 +23426,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype2ParseVariant1ValueV
23430
23426
impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype2ParseVariant1ValueVariant1 {
23431
23427
type Err = self::error::ConversionError;
23432
23428
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23433
- if regress::Regex::new("^(date|utc):.*$")
23434
- .unwrap()
23435
- .find(value)
23436
- .is_none()
23437
- {
23429
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
23430
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
23431
+ if (&*PATTERN).find(value).is_none() {
23438
23432
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
23439
23433
}
23440
23434
Ok(Self(value.to_string()))
@@ -24020,11 +24014,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype3ParseVariant1ValueV
24020
24014
impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype3ParseVariant1ValueVariant1 {
24021
24015
type Err = self::error::ConversionError;
24022
24016
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24023
- if regress::Regex::new("^(date|utc):.*$")
24024
- .unwrap()
24025
- .find(value)
24026
- .is_none()
24027
- {
24017
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
24018
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
24019
+ if (&*PATTERN).find(value).is_none() {
24028
24020
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
24029
24021
}
24030
24022
Ok(Self(value.to_string()))
@@ -25225,11 +25217,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype0ParseVariant1ValueV
25225
25217
impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype0ParseVariant1ValueVariant1 {
25226
25218
type Err = self::error::ConversionError;
25227
25219
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25228
- if regress::Regex::new("^(date|utc):.*$")
25229
- .unwrap()
25230
- .find(value)
25231
- .is_none()
25232
- {
25220
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
25221
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
25222
+ if (&*PATTERN).find(value).is_none() {
25233
25223
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
25234
25224
}
25235
25225
Ok(Self(value.to_string()))
@@ -25747,11 +25737,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype1ParseVariant1ValueV
25747
25737
impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype1ParseVariant1ValueVariant1 {
25748
25738
type Err = self::error::ConversionError;
25749
25739
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25750
- if regress::Regex::new("^(date|utc):.*$")
25751
- .unwrap()
25752
- .find(value)
25753
- .is_none()
25754
- {
25740
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
25741
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
25742
+ if (&*PATTERN).find(value).is_none() {
25755
25743
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
25756
25744
}
25757
25745
Ok(Self(value.to_string()))
@@ -26328,11 +26316,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype2ParseVariant1ValueV
26328
26316
impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype2ParseVariant1ValueVariant1 {
26329
26317
type Err = self::error::ConversionError;
26330
26318
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26331
- if regress::Regex::new("^(date|utc):.*$")
26332
- .unwrap()
26333
- .find(value)
26334
- .is_none()
26335
- {
26319
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
26320
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
26321
+ if (&*PATTERN).find(value).is_none() {
26336
26322
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
26337
26323
}
26338
26324
Ok(Self(value.to_string()))
@@ -26918,11 +26904,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype3ParseVariant1ValueV
26918
26904
impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype3ParseVariant1ValueVariant1 {
26919
26905
type Err = self::error::ConversionError;
26920
26906
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26921
- if regress::Regex::new("^(date|utc):.*$")
26922
- .unwrap()
26923
- .find(value)
26924
- .is_none()
26925
- {
26907
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
26908
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(date|utc):.*$").unwrap());
26909
+ if (&*PATTERN).find(value).is_none() {
26926
26910
return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
26927
26911
}
26928
26912
Ok(Self(value.to_string()))
@@ -31398,7 +31382,9 @@ impl ::std::convert::From<&EncodeKey> for EncodeKey {
31398
31382
impl ::std::str::FromStr for EncodeKey {
31399
31383
type Err = self::error::ConversionError;
31400
31384
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31401
- if regress::Regex::new("^.+$").unwrap().find(value).is_none() {
31385
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
31386
+ ::std::sync::LazyLock::new(|| ::regress::Regex::new("^.+$").unwrap());
31387
+ if (&*PATTERN).find(value).is_none() {
31402
31388
return Err("doesn't match pattern \"^.+$\"".into());
31403
31389
}
31404
31390
Ok(Self(value.to_string()))
@@ -107885,11 +107871,11 @@ impl ::std::convert::From<&TitleVariant1EncodeSubtype0Key> for TitleVariant1Enco
107885
107871
impl ::std::str::FromStr for TitleVariant1EncodeSubtype0Key {
107886
107872
type Err = self::error::ConversionError;
107887
107873
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
107888
- if regress::Regex::new("^(?!interactive|name|style).+$")
107889
- .unwrap()
107890
- .find(value )
107891
- .is_none()
107892
- {
107874
+ static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
107875
+ ::std::sync::LazyLock::new(|| {
107876
+ ::regress::Regex::new("^(?!interactive|name|style).+$").unwrap( )
107877
+ });
107878
+ if (&*PATTERN).find(value).is_none() {
107893
107879
return Err("doesn't match pattern \"^(?!interactive|name|style).+$\"".into());
107894
107880
}
107895
107881
Ok(Self(value.to_string()))
0 commit comments