File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change 1
1
2
- use std:: process:: { Command , Output } ;
3
2
use regex:: Regex ;
4
3
use error:: Result ;
5
4
use failure:: err_msg;
@@ -18,26 +17,6 @@ pub fn parse_rustc_version<S: AsRef<str>>(version: S) -> Result<String> {
18
17
captures. get( 2 ) . unwrap( ) . as_str( ) ) )
19
18
}
20
19
21
-
22
- /// Returns current version of rustc and cratesfyi
23
- pub fn get_current_versions ( ) -> Result < ( String , String ) > {
24
- let rustc_version = command_result ( Command :: new ( "rustc" ) . arg ( "--version" ) . output ( ) ?) ?;
25
- let cratesfyi_version = command_result ( Command :: new ( "rustc" ) . arg ( "--version" ) . output ( ) ?) ?;
26
-
27
- Ok ( ( rustc_version, cratesfyi_version) )
28
- }
29
-
30
-
31
- pub fn command_result ( output : Output ) -> Result < String > {
32
- let mut command_out = String :: from_utf8_lossy ( & output. stdout ) . into_owned ( ) ;
33
- command_out. push_str ( & String :: from_utf8_lossy ( & output. stderr ) . into_owned ( ) [ ..] ) ;
34
- match output. status . success ( ) {
35
- true => Ok ( command_out) ,
36
- false => Err ( err_msg ( command_out) ) ,
37
- }
38
- }
39
-
40
-
41
20
#[ test]
42
21
fn test_parse_rustc_version ( ) {
43
22
assert_eq ! ( parse_rustc_version( "rustc 1.10.0-nightly (57ef01513 2016-05-23)" ) . unwrap( ) ,
You can’t perform that action at this time.
0 commit comments