Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaslyang authored and nicholaslyang committed Sep 1, 2023
1 parent e6bf0b5 commit 8884ce5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions crates/turborepo-lib/src/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ impl From<TaskHashable<'_>> for Builder<HeapAllocator> {
::capnp::message::TypedBuilder::<proto_capnp::task_hashable::Owned>::new_default();
let mut builder = message.init_root();

builder.set_global_hash(&task_hashable.global_hash);
builder.set_global_hash(task_hashable.global_hash);
builder.set_package_dir(&task_hashable.package_dir.to_string());
builder.set_hash_of_files(&task_hashable.hash_of_files);
builder.set_hash_of_files(task_hashable.hash_of_files);
builder.set_external_deps_hash(&task_hashable.external_deps_hash);
builder.set_task(&task_hashable.task);
builder.set_task(task_hashable.task);
builder.set_env_mode(task_hashable.env_mode.into());

{
Expand Down Expand Up @@ -290,7 +290,7 @@ impl<'a> From<GlobalHashable<'a>> for Builder<HeapAllocator> {

let mut builder = message.init_root();

builder.set_global_cache_key(&hashable.global_cache_key);
builder.set_global_cache_key(hashable.global_cache_key);

{
let mut entries = builder
Expand Down
4 changes: 2 additions & 2 deletions crates/turborepo-lib/src/run/global_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn get_global_hash_inputs<'a, L: ?Sized + Lockfile>(
dot_env: &'a [RelativeUnixPathBuf],
) -> Result<GlobalHashableInputs<'a>> {
let global_hashable_env_vars =
get_global_hashable_env_vars(env_at_execution_start, &global_env)?;
get_global_hashable_env_vars(env_at_execution_start, global_env)?;

debug!(
"global hash env vars {:?}",
Expand All @@ -68,7 +68,7 @@ pub fn get_global_hash_inputs<'a, L: ?Sized + Lockfile>(

let files = globwalk::globwalk(
root_path,
&global_file_dependencies,
global_file_dependencies,
&globs.raw_exclusions,
WalkType::All,
)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/task_graph/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<'a> Visitor<'a> {
.task_hasher
.calculate_task_hash(
&info,
&task_definition,
task_definition,
task_env_mode,
workspace_info,
dependency_set,
Expand Down
14 changes: 7 additions & 7 deletions crates/turborepo-lib/src/task_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub enum Error {
#[error("missing hash for dependent task {0}")]
MissingDependencyTaskHash(String),
#[error(transparent)]
SCM(#[from] turborepo_scm::Error),
Scm(#[from] turborepo_scm::Error),
#[error(transparent)]
Env(#[from] turborepo_env::Error),
#[error(transparent)]
Expand Down Expand Up @@ -82,7 +82,7 @@ impl PackageInputsHashes {
}

let task_definition = task_definitions
.get(&task_id)
.get(task_id)
.ok_or_else(|| Error::MissingPipelineEntry(task_id.clone()))?;

// TODO: Look into making WorkspaceName take a Cow
Expand Down Expand Up @@ -113,7 +113,7 @@ impl PackageInputsHashes {
.unwrap_or_else(|| AnchoredSystemPath::new("").unwrap());

let mut hash_object = scm.get_package_file_hashes(
&repo_root,
repo_root,
package_path,
&package_file_hash_inputs.task_definition.inputs,
)?;
Expand Down Expand Up @@ -146,7 +146,7 @@ impl PackageInputsHashes {
}

Ok(PackageInputsHashes {
hashes: hashes,
hashes,
expanded_hashes: hash_objects,
})
}
Expand Down Expand Up @@ -266,7 +266,7 @@ impl<'a> TaskHasher<'a> {
.env_at_execution_start
.from_wildcards(&task_definition.env)?;

explicit_env_var_map.union(&mut all_env_var_map);
explicit_env_var_map.union(&all_env_var_map);
}

let env_vars = DetailedMap {
Expand All @@ -278,7 +278,7 @@ impl<'a> TaskHasher<'a> {
};

let hashable_env_pairs = env_vars.all.to_hashable();
let outputs = task_definition.hashable_outputs(&task_id);
let outputs = task_definition.hashable_outputs(task_id);
let task_dependency_hashes = self.calculate_dependency_hashes(dependency_set).await?;

debug!(
Expand Down Expand Up @@ -338,7 +338,7 @@ impl<'a> TaskHasher<'a> {
let task_hash_tracker = self.task_hash_tracker.lock().await;
let dependency_hash = task_hash_tracker
.package_task_hashes
.get(&dependency_task_id)
.get(dependency_task_id)
.ok_or_else(|| Error::MissingDependencyTaskHash(dependency_task.to_string()))?;
dependency_hash_set.insert(dependency_hash.clone());
}
Expand Down
4 changes: 2 additions & 2 deletions crates/turborepo-scm/src/package_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ impl SCM {
allow_missing: bool,
) -> Result<GitHashes, Error> {
if allow_missing {
self.hash_existing_of(&turbo_root, files.into_iter())
self.hash_existing_of(turbo_root, files.iter())
} else {
self.hash_files(&turbo_root, files.into_iter())
self.hash_files(turbo_root, files.iter())
}
}

Expand Down

0 comments on commit 8884ce5

Please sign in to comment.