File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -720,21 +720,19 @@ impl ExtraCheckArg {
720720 if !self . auto {
721721 return true ;
722722 }
723- match self . lang {
723+ let exts: & [ & str ] = match self . lang {
724+ ExtraCheckLang :: Py => & [ ".py" ] ,
725+ ExtraCheckLang :: Cpp => & [ ".cpp" ] ,
726+ ExtraCheckLang :: Shell => & [ ".sh" ] ,
727+ ExtraCheckLang :: Js => & [ ".js" , ".ts" ] ,
724728 ExtraCheckLang :: Spellcheck => {
725- SPELLCHECK_DIRS . iter ( ) . any ( |dir| Path :: new ( filepath) . starts_with ( dir) )
726- }
727- lang => {
728- let exts: & [ & str ] = match lang {
729- ExtraCheckLang :: Py => & [ ".py" ] ,
730- ExtraCheckLang :: Cpp => & [ ".cpp" ] ,
731- ExtraCheckLang :: Shell => & [ ".sh" ] ,
732- ExtraCheckLang :: Js => & [ ".js" , ".ts" ] ,
733- ExtraCheckLang :: Spellcheck => unreachable ! ( ) ,
734- } ;
735- exts. iter ( ) . any ( |ext| filepath. ends_with ( ext) )
729+ if SPELLCHECK_DIRS . iter ( ) . any ( |dir| Path :: new ( filepath) . starts_with ( dir) ) {
730+ return true ;
731+ }
732+ & [ ]
736733 }
737- }
734+ } ;
735+ exts. iter ( ) . any ( |ext| filepath. ends_with ( ext) )
738736 }
739737
740738 fn has_supported_kind ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments