Skip to content

Commit

Permalink
Rename variants.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Sep 29, 2023
1 parent dbf1470 commit 2062ae6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion crates/cli/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub async fn check(
for project in projects {
for task in project.get_tasks()? {
if task.is_build_type() || task.is_test_type() {
targets.push(TargetLocator::Target(task.target.clone()));
targets.push(TargetLocator::Qualified(task.target.clone()));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/core/action-context/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ impl ActionContext {
}

// :task == scope:task
for initial_target in &self.initial_targets {
if target.is_all_task(initial_target) {
for locator in &self.initial_targets {
if target.is_all_task(locator.as_str()) {
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/core/dep-graph/src/dep_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ impl<'ws> DepGraphBuilder<'ws> {

for locator in target_locators {
let result = match locator {
TargetLocator::Target(target) => self.run_target(target, touched_files)?,
TargetLocator::Path(task_id) => {
TargetLocator::Qualified(target) => self.run_target(target, touched_files)?,
TargetLocator::TaskFromWorkingDir(task_id) => {
if project.is_none() {
project = Some(self.project_graph.get_from_path(&cwd)?);
}
Expand Down
12 changes: 6 additions & 6 deletions nextgen/target/src/target_locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::str::FromStr;

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub enum TargetLocator {
Target(Target),
Path(Id),
Qualified(Target), // scope:task_id
TaskFromWorkingDir(Id), // task_id
}

impl TargetLocator {
Expand All @@ -24,8 +24,8 @@ impl AsRef<TargetLocator> for TargetLocator {
impl AsRef<str> for TargetLocator {
fn as_ref(&self) -> &str {
match self {
Self::Target(target) => target.as_str(),
Self::Path(id) => id.as_str(),
Self::Qualified(target) => target.as_str(),
Self::TaskFromWorkingDir(id) => id.as_str(),
}
}
}
Expand All @@ -35,9 +35,9 @@ impl FromStr for TargetLocator {

fn from_str(value: &str) -> Result<Self, Self::Err> {
Ok(if value.contains(':') {
TargetLocator::Target(Target::parse(&value)?)
TargetLocator::Qualified(Target::parse(value)?)
} else {
TargetLocator::Path(Id::new(&value)?)
TargetLocator::TaskFromWorkingDir(Id::new(value)?)
})
}
}
Expand Down

0 comments on commit 2062ae6

Please sign in to comment.