Skip to content

Commit

Permalink
refactor: remove unnecessary function
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Feb 12, 2023
1 parent b59e827 commit 25f5267
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
pub fn prepare(&mut self) -> CargoResult<()> {
let _p = profile::start("preparing layout");

self.files_mut()
self.files
.as_mut()
.unwrap()
.host
.prepare()
.with_context(|| "couldn't prepare build directories")?;
Expand All @@ -375,10 +377,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
self.files.as_ref().unwrap()
}

fn files_mut(&mut self) -> &mut CompilationFiles<'a, 'cfg> {
self.files.as_mut().unwrap()
}

/// Returns the filenames that the given unit will generate.
pub fn outputs(&self, unit: &Unit) -> CargoResult<Arc<Vec<OutputFile>>> {
self.files.as_ref().unwrap().outputs(unit, self.bcx)
Expand Down

0 comments on commit 25f5267

Please sign in to comment.