@@ -22327,11 +22327,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype0ParseVariant1ValueV
2232722327impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype0ParseVariant1ValueVariant1 {
2232822328 type Err = self::error::ConversionError;
2232922329 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() {
2233522333 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2233622334 }
2233722335 Ok(Self(value.to_string()))
@@ -22849,11 +22847,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype1ParseVariant1ValueV
2284922847impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype1ParseVariant1ValueVariant1 {
2285022848 type Err = self::error::ConversionError;
2285122849 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() {
2285722853 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2285822854 }
2285922855 Ok(Self(value.to_string()))
@@ -23430,11 +23426,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype2ParseVariant1ValueV
2343023426impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype2ParseVariant1ValueVariant1 {
2343123427 type Err = self::error::ConversionError;
2343223428 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() {
2343823432 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2343923433 }
2344023434 Ok(Self(value.to_string()))
@@ -24020,11 +24014,9 @@ impl ::std::convert::From<&DataVariant2FormatVariant0Subtype3ParseVariant1ValueV
2402024014impl ::std::str::FromStr for DataVariant2FormatVariant0Subtype3ParseVariant1ValueVariant1 {
2402124015 type Err = self::error::ConversionError;
2402224016 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() {
2402824020 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2402924021 }
2403024022 Ok(Self(value.to_string()))
@@ -25225,11 +25217,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype0ParseVariant1ValueV
2522525217impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype0ParseVariant1ValueVariant1 {
2522625218 type Err = self::error::ConversionError;
2522725219 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() {
2523325223 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2523425224 }
2523525225 Ok(Self(value.to_string()))
@@ -25747,11 +25737,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype1ParseVariant1ValueV
2574725737impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype1ParseVariant1ValueVariant1 {
2574825738 type Err = self::error::ConversionError;
2574925739 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() {
2575525743 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2575625744 }
2575725745 Ok(Self(value.to_string()))
@@ -26328,11 +26316,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype2ParseVariant1ValueV
2632826316impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype2ParseVariant1ValueVariant1 {
2632926317 type Err = self::error::ConversionError;
2633026318 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() {
2633626322 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2633726323 }
2633826324 Ok(Self(value.to_string()))
@@ -26918,11 +26904,9 @@ impl ::std::convert::From<&DataVariant3FormatVariant0Subtype3ParseVariant1ValueV
2691826904impl ::std::str::FromStr for DataVariant3FormatVariant0Subtype3ParseVariant1ValueVariant1 {
2691926905 type Err = self::error::ConversionError;
2692026906 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() {
2692626910 return Err("doesn't match pattern \"^(date|utc):.*$\"".into());
2692726911 }
2692826912 Ok(Self(value.to_string()))
@@ -31398,7 +31382,9 @@ impl ::std::convert::From<&EncodeKey> for EncodeKey {
3139831382impl ::std::str::FromStr for EncodeKey {
3139931383 type Err = self::error::ConversionError;
3140031384 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() {
3140231388 return Err("doesn't match pattern \"^.+$\"".into());
3140331389 }
3140431390 Ok(Self(value.to_string()))
@@ -107885,11 +107871,11 @@ impl ::std::convert::From<&TitleVariant1EncodeSubtype0Key> for TitleVariant1Enco
107885107871impl ::std::str::FromStr for TitleVariant1EncodeSubtype0Key {
107886107872 type Err = self::error::ConversionError;
107887107873 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() {
107893107879 return Err("doesn't match pattern \"^(?!interactive|name|style).+$\"".into());
107894107880 }
107895107881 Ok(Self(value.to_string()))
0 commit comments