From b27d36baee3afdfefc9d66efbafbe940032784ed Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 3 Jun 2024 18:09:42 -0400 Subject: [PATCH] Remove some unnecessary `Interpreter` clones (#3999) --- crates/bench/benches/uv.rs | 6 +++--- crates/uv/src/commands/pip/install.rs | 8 ++++---- crates/uv/src/commands/project/lock.rs | 6 +++--- crates/uv/src/commands/project/mod.rs | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/bench/benches/uv.rs b/crates/bench/benches/uv.rs index a7d96417d..a6f554442 100644 --- a/crates/bench/benches/uv.rs +++ b/crates/bench/benches/uv.rs @@ -135,13 +135,13 @@ mod resolver { let index = InMemoryIndex::default(); let index_locations = IndexLocations::default(); let installed_packages = EmptyInstalledPackages; - let interpreter = venv.interpreter().clone(); - let python_requirement = PythonRequirement::from_marker_environment(&interpreter, &MARKERS); + let interpreter = venv.interpreter(); + let python_requirement = PythonRequirement::from_marker_environment(interpreter, &MARKERS); let build_context = BuildDispatch::new( client, &cache, - &interpreter, + interpreter, &index_locations, &flat_index, &index, diff --git a/crates/uv/src/commands/pip/install.rs b/crates/uv/src/commands/pip/install.rs index 672c3bf7b..056ef22c8 100644 --- a/crates/uv/src/commands/pip/install.rs +++ b/crates/uv/src/commands/pip/install.rs @@ -207,7 +207,7 @@ pub(crate) async fn pip_install( } } - let interpreter = venv.interpreter().clone(); + let interpreter = venv.interpreter(); // Determine the tags, markers, and interpreter to use for resolution. let tags = match (python_platform, python_version.as_ref()) { @@ -310,7 +310,7 @@ pub(crate) async fn pip_install( let resolve_dispatch = BuildDispatch::new( &client, &cache, - &interpreter, + interpreter, &index_locations, &flat_index, &index, @@ -348,7 +348,7 @@ pub(crate) async fn pip_install( &hasher, &reinstall, &upgrade, - &interpreter, + interpreter, &tags, Some(&markers), &client, @@ -383,7 +383,7 @@ pub(crate) async fn pip_install( BuildDispatch::new( &client, &cache, - &interpreter, + interpreter, &index_locations, &flat_index, &index, diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index a97a76303..a8a31626b 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -92,7 +92,7 @@ pub(super) async fn do_lock( let project_name = project.project_name().clone(); // Determine the tags, markers, and interpreter to use for resolution. - let interpreter = venv.interpreter().clone(); + let interpreter = venv.interpreter(); let tags = venv.interpreter().tags()?; let markers = venv.interpreter().markers(); @@ -131,7 +131,7 @@ pub(super) async fn do_lock( let build_dispatch = BuildDispatch::new( &client, cache, - &interpreter, + interpreter, index_locations, &flat_index, &index, @@ -160,7 +160,7 @@ pub(super) async fn do_lock( &hasher, &reinstall, &upgrade, - &interpreter, + interpreter, tags, None, &client, diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index 9d89b45b3..29d2fbf0a 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -149,7 +149,7 @@ pub(crate) async fn update_environment( } // Determine the tags, markers, and interpreter to use for resolution. - let interpreter = venv.interpreter().clone(); + let interpreter = venv.interpreter(); let tags = venv.interpreter().tags()?; let markers = venv.interpreter().markers(); @@ -187,7 +187,7 @@ pub(crate) async fn update_environment( let resolve_dispatch = BuildDispatch::new( &client, cache, - &interpreter, + interpreter, index_locations, &flat_index, &index, @@ -216,7 +216,7 @@ pub(crate) async fn update_environment( &hasher, &reinstall, &upgrade, - &interpreter, + interpreter, tags, Some(markers), &client, @@ -245,7 +245,7 @@ pub(crate) async fn update_environment( BuildDispatch::new( &client, cache, - &interpreter, + interpreter, index_locations, &flat_index, &index,