@@ -112,7 +112,7 @@ use like::ILike;
112
112
113
113
macro_rules! newtype_istr {
114
114
( $typ: ident, $parse: expr, $visitor: ident) => {
115
- #[ derive( Debug , Clone , Eq , PartialEq , PartialOrd , Ord , Hash ) ]
115
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
116
116
pub struct $typ( Arc <str >) ;
117
117
118
118
impl $typ {
@@ -132,7 +132,7 @@ macro_rules! newtype_istr {
132
132
Self ( s)
133
133
}
134
134
135
- pub fn into_lowercase< ' a> ( s: & ' a str ) -> Cow <' a , str > {
135
+ pub fn into_lowercase( s: & str ) -> Cow <' _ , str > {
136
136
let bytes = s. as_bytes( ) ;
137
137
if !bytes. iter( ) . any( u8 :: is_ascii_uppercase) {
138
138
Cow :: Borrowed ( s)
@@ -268,20 +268,10 @@ impl DatasetAliasPattern {
268
268
}
269
269
270
270
pub fn matches ( & self , dataset_handle : & DatasetHandle ) -> bool {
271
- if self . account_name . is_some ( ) && dataset_handle. alias . account_name . is_none ( )
272
- || self . account_name . is_none ( ) && dataset_handle. alias . account_name . is_some ( )
273
- {
274
- return false ;
275
- }
276
- if self . account_name . as_ref ( ) . unwrap ( )
277
- == dataset_handle. alias . account_name . as_ref ( ) . unwrap ( )
271
+ self . account_name == dataset_handle. alias . account_name
278
272
&& self
279
273
. dataset_name_pattern
280
274
. matches ( & dataset_handle. alias . dataset_name )
281
- {
282
- return true ;
283
- }
284
- false
285
275
}
286
276
}
287
277
@@ -332,7 +322,7 @@ newtype_istr!(RepoName, Grammar::match_repo_name, RepoNameSerdeVisitor);
332
322
333
323
////////////////////////////////////////////////////////////////////////////////
334
324
335
- #[ derive( Debug , Clone , Eq , PartialEq , PartialOrd , Ord , Hash ) ]
325
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
336
326
pub struct DatasetAlias {
337
327
pub account_name : Option < AccountName > ,
338
328
pub dataset_name : DatasetName ,
@@ -409,7 +399,7 @@ impl_serde!(DatasetAlias, DatasetAliasSerdeVisitor);
409
399
410
400
////////////////////////////////////////////////////////////////////////////////
411
401
412
- #[ derive( Debug , Clone , Eq , PartialEq , PartialOrd , Ord , Hash ) ]
402
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
413
403
pub struct DatasetAliasRemote {
414
404
pub repo_name : RepoName ,
415
405
pub account_name : Option < AccountName > ,
0 commit comments