@@ -55,14 +55,14 @@ pub enum Regex {
5555
5656impl Regex {
5757 /// Combine this regular expression with the given one.
58- pub const fn combine ( self , other : Regex ) -> Regex {
58+ pub const fn combine ( self , other : Self ) -> Self {
5959 match ( self , other) {
60- ( _, Regex :: MatchAll ) => self ,
61- ( Regex :: MatchAll , _) => other,
60+ ( _, Self :: MatchAll ) => self ,
61+ ( Self :: MatchAll , _) => other,
6262 // It is hard to combine two regular expressions and nearly impossible to do this in a
6363 // const context. Fortunately, for most of the data types, only one regular expression
6464 // is set.
65- _ => Regex :: Unknown ,
65+ _ => Self :: Unknown ,
6666 }
6767 }
6868}
@@ -101,7 +101,7 @@ macro_rules! attributed_string_type {
101101 pub const REGEX : $crate:: v2:: macros:: attributed_string_type:: Regex = attributed_string_type!( @regex $( $attribute) * ) ;
102102 }
103103
104- impl crate :: config:: merge:: Atomic for $name { }
104+ impl $ crate:: config:: merge:: Atomic for $name { }
105105
106106 impl std:: fmt:: Display for $name {
107107 fn fmt( & self , f: & mut std:: fmt:: Formatter <' _>) -> std:: fmt:: Result {
@@ -161,13 +161,13 @@ macro_rules! attributed_string_type {
161161 }
162162
163163 // The JsonSchema implementation requires `max_length`.
164- impl crate :: schemars:: JsonSchema for $name {
164+ impl $ crate:: schemars:: JsonSchema for $name {
165165 fn schema_name( ) -> std:: borrow:: Cow <' static , str > {
166166 std:: stringify!( $name) . into( )
167167 }
168168
169- fn json_schema( _generator: & mut crate :: schemars:: generate:: SchemaGenerator ) -> crate :: schemars:: Schema {
170- crate :: schemars:: json_schema!( {
169+ fn json_schema( _generator: & mut $ crate:: schemars:: generate:: SchemaGenerator ) -> $ crate:: schemars:: Schema {
170+ $ crate:: schemars:: json_schema!( {
171171 "type" : "string" ,
172172 "minLength" : $name:: MIN_LENGTH ,
173173 "maxLength" : if $name:: MAX_LENGTH != usize :: MAX {
@@ -233,16 +233,16 @@ macro_rules! attributed_string_type {
233233 ) ;
234234 } ;
235235 ( @from_str $name: ident, $s: expr, is_rfc_1035_label_name) => {
236- crate :: validation:: is_lowercase_rfc_1035_label( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidRfc1035LabelNameSnafu ) ?;
236+ $ crate:: validation:: is_lowercase_rfc_1035_label( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidRfc1035LabelNameSnafu ) ?;
237237 } ;
238238 ( @from_str $name: ident, $s: expr, is_rfc_1123_dns_subdomain_name) => {
239- crate :: validation:: is_lowercase_rfc_1123_subdomain( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidRfc1123DnsSubdomainNameSnafu ) ?;
239+ $ crate:: validation:: is_lowercase_rfc_1123_subdomain( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidRfc1123DnsSubdomainNameSnafu ) ?;
240240 } ;
241241 ( @from_str $name: ident, $s: expr, is_rfc_1123_label_name) => {
242- crate :: validation:: is_lowercase_rfc_1123_label( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidRfc1123LabelNameSnafu ) ?;
242+ $ crate:: validation:: is_lowercase_rfc_1123_label( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidRfc1123LabelNameSnafu ) ?;
243243 } ;
244244 ( @from_str $name: ident, $s: expr, is_valid_label_value) => {
245- crate :: kvp:: LabelValue :: from_str( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidLabelValueSnafu ) ?;
245+ $ crate:: kvp:: LabelValue :: from_str( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidLabelValueSnafu ) ?;
246246 } ;
247247 ( @from_str $name: ident, $s: expr, is_uid) => {
248248 uuid:: Uuid :: try_parse( $s) . context( $crate:: v2:: macros:: attributed_string_type:: InvalidUidSnafu ) ?;
@@ -321,19 +321,19 @@ macro_rules! attributed_string_type {
321321 } ;
322322 ( @max_length is_rfc_1035_label_name $( $attribute: tt) * ) => {
323323 $crate:: v2:: macros:: attributed_string_type:: min(
324- crate :: validation:: RFC_1035_LABEL_MAX_LENGTH ,
324+ $ crate:: validation:: RFC_1035_LABEL_MAX_LENGTH ,
325325 attributed_string_type!( @max_length $( $attribute) * )
326326 )
327327 } ;
328328 ( @max_length is_rfc_1123_dns_subdomain_name $( $attribute: tt) * ) => {
329329 $crate:: v2:: macros:: attributed_string_type:: min(
330- crate :: validation:: RFC_1123_SUBDOMAIN_MAX_LENGTH ,
330+ $ crate:: validation:: RFC_1123_SUBDOMAIN_MAX_LENGTH ,
331331 attributed_string_type!( @max_length $( $attribute) * )
332332 )
333333 } ;
334334 ( @max_length is_rfc_1123_label_name $( $attribute: tt) * ) => {
335335 $crate:: v2:: macros:: attributed_string_type:: min(
336- crate :: validation:: RFC_1123_LABEL_MAX_LENGTH ,
336+ $ crate:: validation:: RFC_1123_LABEL_MAX_LENGTH ,
337337 attributed_string_type!( @max_length $( $attribute) * )
338338 )
339339 } ;
0 commit comments