Skip to content

Commit

Permalink
Update resource_info.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
asr2003 authored Dec 14, 2024
1 parent 3f82c5d commit e1572b6
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions nativelink-util/src/resource_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,6 @@ impl<'a> ResourceInfo<'a> {
&mut end_bytes_processed,
)
.err_tip(|| format!("{ERROR_MSG} in {resource_name}"))?;
// Default digest_function to sha256 if not set
if output.digest_function.is_none() {
output.digest_function = Some(Cow::Borrowed("sha256"));
}

if let Some(digest_function) = &output.digest_function {
if !DIGEST_FUNCTIONS.contains(&digest_function.as_ref()) {
return Err(make_input_err!(
"Unsupported digest_function: {}",
digest_function
));
}
}

error_if!(
end_state != State::OptionalMetadata,
Expand Down Expand Up @@ -270,10 +257,6 @@ fn recursive_parse<'a>(
*bytes_processed += part.len() + SLASH_SIZE;
return Ok(state);
}
if output.digest_function.is_none() {
// Default to "sha256" when no digest function is provided.
output.digest_function = Some(Cow::Borrowed("sha256"));
}
continue;
}
State::Hash => {
Expand Down

0 comments on commit e1572b6

Please sign in to comment.