Skip to content

Commit 9d32869

Browse files
committed
Issue #92: small readability improvements
1 parent 6d61a79 commit 9d32869

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ custom_lint:
4545

4646
- avoid_non_null_assertion
4747
- avoid_returning_widgets
48+
- avoid_unnecessary_return_variable
4849
- avoid_unnecessary_setstate
4950
- avoid_unnecessary_type_assertions
5051
- avoid_unnecessary_type_casts
@@ -56,7 +57,6 @@ custom_lint:
5657
- cyclomatic_complexity:
5758
max_complexity: 10
5859

59-
- avoid_unnecessary_return_variable
6060
- double_literal_format
6161

6262
- function_lines_of_code:

lib/src/lints/avoid_unnecessary_return_variable/avoid_unnecessary_return_variable_rule.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ Rewrite the variable evaluation into return statement instead.""",
137137

138138
bool _isSimpleIdentifierImmutable(SimpleIdentifier identifier) {
139139
switch (identifier.element) {
140-
case final VariableElement2 variable
141-
when variable.isFinal || variable.isConst:
142-
return true;
140+
case final VariableElement2 variable:
141+
return variable.isFinal || variable.isConst;
143142

144143
case ClassElement2 _:
145144
return true;

0 commit comments

Comments
 (0)