File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,25 @@ impl Toolchain {
178
178
} ) ,
179
179
} ;
180
180
181
+ /// Returns whether or not this toolchain is needed by rustwide itself.
182
+ ///
183
+ /// This toolchain is used for doing things like installing tools.
184
+ ///
185
+ /// ```rust
186
+ /// # use rustwide::Toolchain;
187
+ /// let tc = Toolchain::dist("stable-x86_64-unknown-linux-gnu");
188
+ /// assert!(tc.is_needed_by_rustwide());
189
+ /// let tc = Toolchain::dist("nightly-x86_64-unknown-linux-gnu");
190
+ /// assert!(!tc.is_needed_by_rustwide());
191
+ /// ```
192
+ pub fn is_needed_by_rustwide ( & self ) -> bool {
193
+ match & self . inner {
194
+ ToolchainInner :: Dist ( dist) => dist. name . starts_with ( MAIN_TOOLCHAIN_NAME ) ,
195
+ #[ cfg( feature = "unstable-toolchain-ci" ) ]
196
+ _ => false ,
197
+ }
198
+ }
199
+
181
200
/// Create a new dist toolchain.
182
201
///
183
202
/// Dist toolchains are all the toolchains available through rustup and distributed from
You can’t perform that action at this time.
0 commit comments