Avoid cloning to string when creating cache path (#11772)

## Summary

Not important but there's no need to allocate to `String` here.
This commit is contained in:
Charlie Marsh 2025-02-24 21:05:16 -10:00 committed by GitHub
parent ce3654da77
commit 3a18f31751
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,7 +98,7 @@ impl<'a> RegistryWheelIndex<'a> {
// Index all the wheels that were downloaded directly from the registry.
let wheel_dir = cache.shard(
CacheBucket::Wheels,
WheelCache::Index(index.url()).wheel_dir(package.to_string()),
WheelCache::Index(index.url()).wheel_dir(package.as_ref()),
);
// For registry wheels, the cache structure is: `<index>/<package-name>/<wheel>.http`
@ -166,7 +166,7 @@ impl<'a> RegistryWheelIndex<'a> {
// from the registry.
let cache_shard = cache.shard(
CacheBucket::SourceDistributions,
WheelCache::Index(index.url()).wheel_dir(package.to_string()),
WheelCache::Index(index.url()).wheel_dir(package.as_ref()),
);
// For registry source distributions, the cache structure is: `<index>/<package-name>/<version>/`.