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> {
4242 return Err ( error. into ( ) ) ;
4343 }
4444
45- // eg: rustc 1.87.0 (17067e9ac 2025-05-09)
45+ // eg: rustc 1.87.0-(optionally nightly) (17067e9ac 2025-05-09)
4646 // Assume the format does not change.
4747 let [ major, minor, patch] = std:: str:: from_utf8 ( & output. stdout ) ?
4848 . split_whitespace ( )
4949 . nth ( 1 )
5050 . unwrap ( )
5151 . split ( '.' )
5252 . 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+ } )
5460 . collect :: < Result < Vec < u8 > , ParseIntError > > ( ) ?
5561 . try_into ( )
5662 . unwrap ( ) ;
@@ -72,7 +78,7 @@ pub fn rustc_host() -> Result<String> {
7278 return Err ( error. into ( ) ) ;
7379 }
7480
75- // eg: rustc 1.87.0 (17067e9ac 2025-05-09)
81+ // eg: rustc 1.87.0-(optionally nightly) (17067e9ac 2025-05-09)
7682 // binary: rustc
7783 // commit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359
7884 // commit-date: 2025-05-09
You can’t perform that action at this time.
0 commit comments