File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,21 @@ pub fn rustc_version() -> Result<RustcVersion> {
42
42
return Err ( error. into ( ) ) ;
43
43
}
44
44
45
- // eg: rustc 1.87.0 (17067e9ac 2025-05-09)
45
+ // eg: rustc 1.87.0-(optionally nightly) (17067e9ac 2025-05-09)
46
46
// Assume the format does not change.
47
47
let [ major, minor, patch] = std:: str:: from_utf8 ( & output. stdout ) ?
48
48
. split_whitespace ( )
49
49
. nth ( 1 )
50
50
. unwrap ( )
51
51
. split ( '.' )
52
52
. take ( 3 )
53
- . map ( |s| s. parse :: < u8 > ( ) )
53
+ . map ( |s| {
54
+ s. chars ( )
55
+ . take_while ( |c| c. is_ascii_digit ( ) )
56
+ . collect :: < String > ( )
57
+ . trim ( )
58
+ . parse :: < u8 > ( )
59
+ } )
54
60
. collect :: < Result < Vec < u8 > , ParseIntError > > ( ) ?
55
61
. try_into ( )
56
62
. unwrap ( ) ;
@@ -72,7 +78,7 @@ pub fn rustc_host() -> Result<String> {
72
78
return Err ( error. into ( ) ) ;
73
79
}
74
80
75
- // eg: rustc 1.87.0 (17067e9ac 2025-05-09)
81
+ // eg: rustc 1.87.0-(optionally nightly) (17067e9ac 2025-05-09)
76
82
// binary: rustc
77
83
// commit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359
78
84
// commit-date: 2025-05-09
You can’t perform that action at this time.
0 commit comments