From 3a18f3175106aba5972e81dad3c5f5da868b869b Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 24 Feb 2025 21:05:16 -1000 Subject: [PATCH] Avoid cloning to string when creating cache path (#11772) ## Summary Not important but there's no need to allocate to `String` here. --- crates/uv-distribution/src/index/registry_wheel_index.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/uv-distribution/src/index/registry_wheel_index.rs b/crates/uv-distribution/src/index/registry_wheel_index.rs index 257ad91b9..09fc9b794 100644 --- a/crates/uv-distribution/src/index/registry_wheel_index.rs +++ b/crates/uv-distribution/src/index/registry_wheel_index.rs @@ -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: `//.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: `///`.