@@ -132,32 +132,29 @@ impl EarlyProps {
132
132
133
133
fn ignore_gdb ( config : & Config , line : & str ) -> bool {
134
134
if let Some ( actual_version) = config. gdb_version {
135
- if line. starts_with ( "min-gdb-version" ) {
136
- let ( start_ver, end_ver) = extract_gdb_version_range ( line ) ;
135
+ if let Some ( rest ) = line. strip_prefix ( "min-gdb-version:" ) . map ( str :: trim ) {
136
+ let ( start_ver, end_ver) = extract_gdb_version_range ( rest ) ;
137
137
138
138
if start_ver != end_ver {
139
139
panic ! ( "Expected single GDB version" )
140
140
}
141
141
// Ignore if actual version is smaller the minimum required
142
142
// version
143
- actual_version < start_ver
144
- } else if line. starts_with ( "ignore-gdb-version" ) {
145
- let ( min_version, max_version) = extract_gdb_version_range ( line ) ;
143
+ return actual_version < start_ver;
144
+ } else if let Some ( rest ) = line. strip_prefix ( "ignore-gdb-version:" ) . map ( str :: trim ) {
145
+ let ( min_version, max_version) = extract_gdb_version_range ( rest ) ;
146
146
147
147
if max_version < min_version {
148
148
panic ! ( "Malformed GDB version range: max < min" )
149
149
}
150
150
151
- actual_version >= min_version && actual_version <= max_version
152
- } else {
153
- false
151
+ return actual_version >= min_version && actual_version <= max_version;
154
152
}
155
- } else {
156
- false
157
153
}
154
+ false
158
155
}
159
156
160
- // Takes a directive of the form "ignore-gdb-version <version1> [- <version2>]",
157
+ // Takes a directive of the form "<version1> [- <version2>]",
161
158
// returns the numeric representation of <version1> and <version2> as
162
159
// tuple: (<version1> as u32, <version2> as u32)
163
160
// If the <version2> part is omitted, the second component of the tuple
0 commit comments