Skip to content

Commit

Permalink
chore: clean unused parameter
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Nov 9, 2023
1 parent 752443c commit d1ca387
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/satellite/src/storage/certification/cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn build_asset_certificate_header_v2_impl(

let tree = match rewrite_source {
None => asset_hashes.witness_v2(url),
Some(destination) => asset_hashes.witness_rewrite_v2(url, destination),
Some(_) => asset_hashes.witness_rewrite_v2(url),
};

let mut serializer = Serializer::new(vec![]);
Expand Down
4 changes: 2 additions & 2 deletions src/satellite/src/storage/certification/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ impl CertifiedAssetHashes {
)
}

pub fn witness_rewrite_v2(&self, absolute_path: &str, rewrite: &str) -> HashTree {
pub fn witness_rewrite_v2(&self, absolute_path: &str) -> HashTree {
assert!(absolute_path.starts_with('/'));

// Witness incorrect url: e.g. /1234
let segments = nested_tree_path(absolute_path, EXACT_MATCH_TERMINATOR);
let absence_proof = self.tree_v2.witness(&segments);

// Fallback
// Fallback to search for non conflicting rewrites starting the search from root
let fallback_paths = fallback_paths(segments.clone());

// Witness fallback paths with the absence of proof to validate it can be rewritten
Expand Down
5 changes: 1 addition & 4 deletions src/satellite/src/storage/rewrites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ pub fn redirect_url(requested_path: &str, config: &StorageConfig) -> Option<Stor
matches.first().map(|(_, redirect)| redirect.clone())
}

fn matching_urls<T: Clone>(
requested_path: &str,
config: &HashMap<String, T>,
) -> Vec<(String, T)> {
fn matching_urls<T: Clone>(requested_path: &str, config: &HashMap<String, T>) -> Vec<(String, T)> {
let mut matches: Vec<(String, T)> = matching_urls_utils(requested_path, config);

matches.sort_by(|(a, _), (b, _)| {
Expand Down

0 comments on commit d1ca387

Please sign in to comment.