Skip to content

Commit

Permalink
Remove unnecessary clones, document out_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton committed Oct 27, 2021
1 parent e4a65b9 commit 0deeea8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
/// Returns the directory where the artifacts for the given unit are
/// initially created.
pub fn out_dir(&self, unit: &Unit) -> PathBuf {
// Docscrape units need to have doc/ set as the out_dir so sources for reverse-dependencies
// will be put into doc/ and not into deps/ where the *.examples files are stored.
if unit.mode.is_doc() || unit.mode.is_doc_scrape() {
self.layout(unit.kind).doc().to_path_buf()
} else if unit.mode.is_doc_test() {
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/ops/cargo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl Packages {
}
}

#[derive(Debug, PartialEq, Eq, Clone)]
#[derive(Debug, PartialEq, Eq)]
pub enum LibRule {
/// Include the library, fail if not present
True,
Expand All @@ -239,13 +239,13 @@ pub enum LibRule {
False,
}

#[derive(Debug, Clone)]
#[derive(Debug)]
pub enum FilterRule {
All,
Just(Vec<String>),
}

#[derive(Debug, Clone)]
#[derive(Debug)]
pub enum CompileFilter {
Default {
/// Flag whether targets can be safely skipped when required-features are not satisfied.
Expand Down

0 comments on commit 0deeea8

Please sign in to comment.