File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
rusty_linter/src/pre_linter Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,12 @@ use rusty_variant::Variant;
66
77use crate :: core:: * ;
88
9- pub type ConstantMap = HashMap < BareName , Variant > ;
9+ #[ derive( Default ) ]
10+ pub struct ConstantMap ( HashMap < BareName , Variant > ) ;
1011
1112impl ConstLookup for ConstantMap {
1213 fn get_resolved_constant ( & self , name : & CaseInsensitiveString ) -> Option < & Variant > {
13- self . get ( name)
14+ self . 0 . get ( name)
1415 }
1516}
1617
@@ -20,7 +21,7 @@ impl Visitor<Constant> for ConstantMap {
2021 let ( name_pos, expression_pos) = element. into ( ) ;
2122 let Positioned { element : name, pos } = name_pos;
2223 let bare_name: & BareName = name. bare_name ( ) ;
23- ( match self . get ( bare_name) {
24+ ( match self . 0 . get ( bare_name) {
2425 Some ( _) => Err ( LintError :: DuplicateDefinition . at ( pos) ) ,
2526 _ => Ok ( ( ) ) ,
2627 } )
@@ -30,7 +31,7 @@ impl Visitor<Constant> for ConstantMap {
3031 Name :: Qualified ( _, qualifier) => v. cast ( * qualifier) . map_err ( |e| e. at ( expression_pos) ) ,
3132 } )
3233 . map ( |casted| {
33- self . insert ( bare_name. clone ( ) , casted) ;
34+ self . 0 . insert ( bare_name. clone ( ) , casted) ;
3435 } )
3536 }
3637}
You can’t perform that action at this time.
0 commit comments