@@ -181,17 +181,18 @@ fn match_expr_placeholder(
181181 contains_name(compiled.expr_metavars, name) {
182182 Some (bind_value(bindings, name, candidate))
183183 } else if contains_name(compiled.identifier_metavars, name) {
184- match candidate.normalized_expr_identifier_name() {
185- Some (candidate_name) =>
186- Some (
187- bind_value(bindings, name, string_binding(candidate_name, candidate)),
188- )
189- None => Some (false )
184+ if candidate.normalized_expr_identifier_name() is Some (candidate_name ) {
185+ Some (
186+ bind_value(bindings, name, string_binding(candidate_name, candidate)),
187+ )
188+ } else {
189+ Some (false )
190190 }
191191 } else if contains_name(compiled.constant_metavars, name) {
192- match expr_constant(candidate) {
193- Some (constant) => Some (bind_value(bindings, name, constant))
194- None => Some (false )
192+ if expr_constant(candidate) is Some (constant) {
193+ Some (bind_value(bindings, name, constant))
194+ } else {
195+ Some (false )
195196 }
196197 } else {
197198 None
@@ -216,17 +217,18 @@ fn match_pattern_placeholder(
216217 } else if is_ignore_placeholder(name) {
217218 Some (true )
218219 } else if contains_name(compiled.identifier_metavars, name) {
219- match candidate.normalized_pattern_identifier_name() {
220- Some (candidate_name) =>
221- Some (
222- bind_value(bindings, name, string_binding(candidate_name, candidate)),
223- )
224- None => Some (false )
220+ if candidate.normalized_pattern_identifier_name() is Some (candidate_name ) {
221+ Some (
222+ bind_value(bindings, name, string_binding(candidate_name, candidate)),
223+ )
224+ } else {
225+ Some (false )
225226 }
226227 } else if contains_name(compiled.constant_metavars, name) {
227- match pattern_constant(candidate) {
228- Some (constant) => Some (bind_value(bindings, name, constant))
229- None => Some (false )
228+ if pattern_constant(candidate) is Some (constant) {
229+ Some (bind_value(bindings, name, constant))
230+ } else {
231+ Some (false )
230232 }
231233 } else {
232234 None
@@ -783,35 +785,35 @@ fn constructor_name(node : @untyped_ast.Node) -> String? {
783785///|
784786fn normalized_constructor(constr : @untyped_ast.Node ) -> String {
785787 let name = constructor_name(constr).unwrap_or("")
786- match child(constr, "extra_info") {
787- Some (extra) =>
788- match extra.kind {
789- ConstructorExtraInfo_NoExtraInfo => name
790- ConstructorExtraInfo_Package =>
791- if leaf_string_child(extra, "value") is Some (pkg) {
792- "@\{pkg}.\{name}"
788+ if child(constr, "extra_info") is Some (extra) {
789+ match extra.kind {
790+ ConstructorExtraInfo_NoExtraInfo => name
791+ ConstructorExtraInfo_Package =>
792+ if leaf_string_child(extra, "value") is Some (pkg) {
793+ "@\{pkg}.\{name}"
794+ } else {
795+ name
796+ }
797+ ConstructorExtraInfo_TypeName =>
798+ if child(extra, "value") is Some (type_name) {
799+ "\{normalized_type_name(type_name)}::\{name}"
800+ } else {
801+ name
802+ }
803+ ConstructorExtraInfo_TypeNameWithConstrPackage =>
804+ if child(extra, "type_name") is Some (type_name) {
805+ if leaf_string_child(extra, "pkg") is Some (pkg) {
806+ "\{normalized_type_name(type_name)}::@\{pkg}.\{name}"
793807 } else {
794- name
795- }
796- ConstructorExtraInfo_TypeName =>
797- if child(extra, "value") is Some (type_name) {
798808 "\{normalized_type_name(type_name)}::\{name}"
799- } else {
800- name
801809 }
802- ConstructorExtraInfo_TypeNameWithConstrPackage =>
803- if child(extra, "type_name") is Some (type_name) {
804- if leaf_string_child(extra, "pkg") is Some (pkg) {
805- "\{normalized_type_name(type_name)}::@\{pkg}.\{name}"
806- } else {
807- "\{normalized_type_name(type_name)}::\{name}"
808- }
809- } else {
810- name
811- }
812- _ => name
813- }
814- None => name
810+ } else {
811+ name
812+ }
813+ _ => name
814+ }
815+ } else {
816+ name
815817 }
816818}
817819
0 commit comments