Skip to content

Commit

Permalink
Run rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Nov 10, 2021
1 parent 3afafa8 commit 6fba61f
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ impl<'a> DistributableToolchain<'a> {
}

// Validate the component name
let rust_pkg = desc.manifest
let rust_pkg = desc
.manifest
.packages
.get("rust")
.expect("manifest should contain a rust package");
Expand All @@ -553,7 +554,11 @@ impl<'a> DistributableToolchain<'a> {
return Err(RustupError::UnknownComponent {
name: self.0.name.to_string(),
component: component.description(&desc.manifest),
suggestion: self.get_component_suggestion(&component, &desc.manifest, false),
suggestion: self.get_component_suggestion(
&component,
&desc.manifest,
false,
),
}
.into());
}
Expand Down Expand Up @@ -782,7 +787,9 @@ impl<'a> DistributableToolchain<'a> {
}
}

pub(crate) fn get_toolchain_desc_with_manifest(&self) -> Result<Option<ToolchainDescWithManifest>> {
pub(crate) fn get_toolchain_desc_with_manifest(
&self,
) -> Result<Option<ToolchainDescWithManifest>> {
if !self.0.exists() {
bail!(RustupError::ToolchainNotInstalled(self.0.name.to_owned()));
}
Expand All @@ -792,8 +799,13 @@ impl<'a> DistributableToolchain<'a> {

let prefix = InstallPrefix::from(self.0.path.to_owned());
let manifestation = Manifestation::open(prefix, toolchain.target.clone())?;
Ok(manifestation.load_manifest()?
.map(|manifest| ToolchainDescWithManifest { toolchain, manifestation, manifest }))
Ok(manifestation
.load_manifest()?
.map(|manifest| ToolchainDescWithManifest {
toolchain,
manifestation,
manifest,
}))
}

pub fn list_components(&self) -> Result<Vec<ComponentStatus>> {
Expand Down Expand Up @@ -911,7 +923,8 @@ impl ToolchainDescWithManifest {
// toolchain's target triple.
let mut res = Vec::new();

let rust_pkg = self.manifest
let rust_pkg = self
.manifest
.packages
.get("rust")
.expect("manifest should contain a rust package");
Expand All @@ -929,7 +942,8 @@ impl ToolchainDescWithManifest {
let component_target = TargetTriple::new(&component.target());

// Get the component so we can check if it is available
let component_pkg = self.manifest
let component_pkg = self
.manifest
.get_package(component.short_name_in_manifest())
.unwrap_or_else(|_| {
panic!(
Expand Down

0 comments on commit 6fba61f

Please sign in to comment.