@@ -1114,33 +1114,33 @@ impl ImportDescriptor {
1114
1114
pub struct EnvDescriptorParseError ;
1115
1115
1116
1116
#[ derive( Clone , Eq , PartialEq , Hash , Debug ) ]
1117
- enum EnvQueryDescriptorInner {
1117
+ pub enum EnvDescriptor {
1118
1118
Name ( EnvVarName ) ,
1119
1119
PrefixPattern ( EnvVarName ) ,
1120
1120
}
1121
1121
1122
- #[ derive( Clone , Eq , PartialEq , Hash , Debug ) ]
1123
- pub struct EnvQueryDescriptor ( EnvQueryDescriptorInner ) ;
1124
-
1125
- impl EnvQueryDescriptor {
1122
+ impl EnvDescriptor {
1126
1123
pub fn new ( env : impl AsRef < str > ) -> Self {
1127
- Self ( EnvQueryDescriptorInner :: Name ( EnvVarName :: new ( env) ) )
1124
+ if let Some ( prefix_pattern) = env. as_ref ( ) . strip_suffix ( '*' ) {
1125
+ Self :: PrefixPattern ( EnvVarName :: new ( prefix_pattern) )
1126
+ } else {
1127
+ Self :: Name ( EnvVarName :: new ( env) )
1128
+ }
1128
1129
}
1129
1130
}
1130
1131
1131
1132
#[ derive( Clone , Eq , PartialEq , Hash , Debug ) ]
1132
- pub enum EnvDescriptor {
1133
+ enum EnvQueryDescriptorInner {
1133
1134
Name ( EnvVarName ) ,
1134
1135
PrefixPattern ( EnvVarName ) ,
1135
1136
}
1136
1137
1137
- impl EnvDescriptor {
1138
+ #[ derive( Clone , Eq , PartialEq , Hash , Debug ) ]
1139
+ pub struct EnvQueryDescriptor ( EnvQueryDescriptorInner ) ;
1140
+
1141
+ impl EnvQueryDescriptor {
1138
1142
pub fn new ( env : impl AsRef < str > ) -> Self {
1139
- if let Some ( prefix_pattern) = env. as_ref ( ) . strip_suffix ( '*' ) {
1140
- Self :: PrefixPattern ( EnvVarName :: new ( prefix_pattern) )
1141
- } else {
1142
- Self :: Name ( EnvVarName :: new ( env) )
1143
- }
1143
+ Self ( EnvQueryDescriptorInner :: Name ( EnvVarName :: new ( env) ) )
1144
1144
}
1145
1145
}
1146
1146
0 commit comments