File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ use std::fmt::Write;
12
12
use super :: commands;
13
13
use super :: list_commands;
14
14
use crate :: command_prelude:: * ;
15
+ use crate :: util:: is_rustup;
15
16
use cargo:: core:: features:: HIDDEN ;
16
17
17
18
pub fn main ( config : & mut LazyConfig ) -> CliResult {
@@ -511,11 +512,7 @@ impl GlobalArgs {
511
512
}
512
513
513
514
pub fn cli ( ) -> Command {
514
- // ALLOWED: `RUSTUP_HOME` should only be read from process env, otherwise
515
- // other tools may point to executables from incompatible distributions.
516
- #[ allow( clippy:: disallowed_methods) ]
517
- let is_rustup = std:: env:: var_os ( "RUSTUP_HOME" ) . is_some ( ) ;
518
- let usage = if is_rustup {
515
+ let usage = if is_rustup ( ) {
519
516
"cargo [+toolchain] [OPTIONS] [COMMAND]\n cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]..."
520
517
} else {
521
518
"cargo [OPTIONS] [COMMAND]\n cargo [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]..."
Original file line number Diff line number Diff line change @@ -66,6 +66,13 @@ pub mod toml_mut;
66
66
mod vcs;
67
67
mod workspace;
68
68
69
+ pub fn is_rustup ( ) -> bool {
70
+ // ALLOWED: `RUSTUP_HOME` should only be read from process env, otherwise
71
+ // other tools may point to executables from incompatible distributions.
72
+ #[ allow( clippy:: disallowed_methods) ]
73
+ std:: env:: var_os ( "RUSTUP_HOME" ) . is_some ( )
74
+ }
75
+
69
76
pub fn elapsed ( duration : Duration ) -> String {
70
77
let secs = duration. as_secs ( ) ;
71
78
You can’t perform that action at this time.
0 commit comments