diff --git a/crates/uv/src/commands/pip/compile.rs b/crates/uv/src/commands/pip/compile.rs index 36d62f6e0..2d73bde15 100644 --- a/crates/uv/src/commands/pip/compile.rs +++ b/crates/uv/src/commands/pip/compile.rs @@ -1,6 +1,5 @@ use std::env; use std::io::stdout; -use std::ops::Deref; use std::path::Path; use anstream::{eprint, AutoStream, StripStream}; @@ -207,9 +206,9 @@ pub(crate) async fn pip_compile( // distributions will be built against the installed version, and so the index may contain // different package priorities than in the top-level resolution. let top_level_index = if python_version.is_some() { - InMemoryIndexRef::Owned(InMemoryIndex::default()) + InMemoryIndex::default() } else { - InMemoryIndexRef::Borrowed(&source_index) + source_index.clone() }; // Determine the Python requirement, if the user requested a specific version. @@ -597,20 +596,3 @@ impl OutputWriter { Ok(()) } } - -/// An owned or unowned [`InMemoryIndex`]. -enum InMemoryIndexRef<'a> { - Owned(InMemoryIndex), - Borrowed(&'a InMemoryIndex), -} - -impl Deref for InMemoryIndexRef<'_> { - type Target = InMemoryIndex; - - fn deref(&self) -> &Self::Target { - match self { - Self::Owned(index) => index, - Self::Borrowed(index) => index, - } - } -}