@@ -515,31 +515,12 @@ pub fn create_default_http_client() -> Client {
515
515
. unwrap_or_default ( )
516
516
}
517
517
518
- // ----------------------------------------------------------
519
- // Private functions
520
- // ----------------------------------------------------------
521
-
522
- fn get_index_version ( full_version : & str , index : usize ) -> Result < String , Box < dyn Error > > {
523
- let version_vec: Vec < & str > = full_version. split ( '.' ) . collect ( ) ;
524
- Ok ( version_vec
525
- . get ( index)
526
- . ok_or ( format ! ( "Wrong version: {}" , full_version) ) ?
527
- . to_string ( ) )
528
- }
529
-
530
518
pub fn http_client_builder ( ) -> ClientBuilder {
531
519
Client :: builder ( )
532
520
. danger_accept_invalid_certs ( true )
533
521
. use_rustls_tls ( )
534
522
}
535
523
536
- fn strip_trailing_newline ( input : & str ) -> & str {
537
- input
538
- . strip_suffix ( CRLF )
539
- . or_else ( || input. strip_suffix ( LF ) )
540
- . unwrap_or ( input)
541
- }
542
-
543
524
pub fn run_shell_command ( os : & str , command : String ) -> Result < String , Box < dyn Error > > {
544
525
let ( shell, flag) = if WINDOWS . is ( os) {
545
526
( "cmd" , "/C" )
@@ -563,6 +544,25 @@ pub fn format_two_args(string: &str, arg1: &str, arg2: &str) -> String {
563
544
string. replacen ( "{}" , arg1, 1 ) . replacen ( "{}" , arg2, 2 )
564
545
}
565
546
547
+ // ----------------------------------------------------------
548
+ // Private functions
549
+ // ----------------------------------------------------------
550
+
551
+ fn get_index_version ( full_version : & str , index : usize ) -> Result < String , Box < dyn Error > > {
552
+ let version_vec: Vec < & str > = full_version. split ( '.' ) . collect ( ) ;
553
+ Ok ( version_vec
554
+ . get ( index)
555
+ . ok_or ( format ! ( "Wrong version: {}" , full_version) ) ?
556
+ . to_string ( ) )
557
+ }
558
+
559
+ fn strip_trailing_newline ( input : & str ) -> & str {
560
+ input
561
+ . strip_suffix ( CRLF )
562
+ . or_else ( || input. strip_suffix ( LF ) )
563
+ . unwrap_or ( input)
564
+ }
565
+
566
566
fn split_lines ( string : & str ) -> Vec < & str > {
567
567
if string. contains ( CRLF ) {
568
568
string. split ( CRLF ) . collect ( )
0 commit comments