@@ -848,11 +848,11 @@ fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
848
848
let patch = splits. next ( ) ;
849
849
850
850
let major: u32 = major. parse ( ) . unwrap ( ) ;
851
- let ( minor, patch) : ( u32 , u32 ) = match minor. find ( | c : char | !c . is_digit ( 10 ) ) {
851
+ let ( minor, patch) : ( u32 , u32 ) = match minor. find ( not_a_digit ) {
852
852
None => {
853
853
let minor = minor. parse ( ) . unwrap ( ) ;
854
854
let patch: u32 = match patch {
855
- Some ( patch) => match patch. find ( | c : char | !c . is_digit ( 10 ) ) {
855
+ Some ( patch) => match patch. find ( not_a_digit ) {
856
856
None => patch. parse ( ) . unwrap ( ) ,
857
857
Some ( idx) if idx > 3 => 0 ,
858
858
Some ( idx) => patch[ ..idx] . parse ( ) . unwrap ( ) ,
@@ -898,15 +898,19 @@ fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> {
898
898
if let Some ( apple_ver) =
899
899
full_version_line. strip_prefix ( "LLDB-" ) . or_else ( || full_version_line. strip_prefix ( "lldb-" ) )
900
900
{
901
- if let Some ( idx) = apple_ver. find ( | c : char | !c . is_digit ( 10 ) ) {
901
+ if let Some ( idx) = apple_ver. find ( not_a_digit ) {
902
902
let version: u32 = apple_ver[ ..idx] . parse ( ) . unwrap ( ) ;
903
903
return Some ( ( version, full_version_line. contains ( "rust-enabled" ) ) ) ;
904
904
}
905
905
} else if let Some ( lldb_ver) = full_version_line. strip_prefix ( "lldb version " ) {
906
- if let Some ( idx) = lldb_ver. find ( | c : char | !c . is_digit ( 10 ) ) {
906
+ if let Some ( idx) = lldb_ver. find ( not_a_digit ) {
907
907
let version: u32 = lldb_ver[ ..idx] . parse ( ) . unwrap ( ) ;
908
908
return Some ( ( version * 100 , full_version_line. contains ( "rust-enabled" ) ) ) ;
909
909
}
910
910
}
911
911
None
912
912
}
913
+
914
+ fn not_a_digit ( c : char ) -> bool {
915
+ !c. is_digit ( 10 )
916
+ }
0 commit comments