From c461c0ec1ecb343d171b3164d7ecd38f8ac45151 Mon Sep 17 00:00:00 2001 From: kellda <59569234+kellda@users.noreply.github.com> Date: Sat, 6 Jun 2020 06:15:44 +0000 Subject: [PATCH] add remove_component to Toolchain --- CHANGELOG.md | 4 ++++ src/toolchain.rs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4db389..e5cc5e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- New method `Toolchain::remove_component` + ## [0.8.0] - 2020-06-05 ### Added diff --git a/src/toolchain.rs b/src/toolchain.rs index 930db8d..57a4fa5 100644 --- a/src/toolchain.rs +++ b/src/toolchain.rs @@ -239,6 +239,16 @@ impl Toolchain { self.change_rustup_thing(workspace, RustupAction::Add, RustupThing::Component, name) } + /// Remove a component already installed for the toolchain. + pub fn remove_component(&self, workspace: &Workspace, name: &str) -> Result<(), Error> { + self.change_rustup_thing( + workspace, + RustupAction::Remove, + RustupThing::Component, + name, + ) + } + /// Download and install a target for the toolchain. /// /// If the toolchain is not installed in the workspace an error will be returned. This is only