Use borrowed data in BuildDispatch (#679)

This PR uses borrowed data in `BuildDispatch` which makes creating a
`BuildDispatch` extremely cheap (only one allocation, for the Python
executable). I can be talked out of this, it will have no measurable
impact.
This commit is contained in:
Charlie Marsh
2023-12-18 11:43:03 -05:00
committed by GitHub
parent c400ab7d07
commit dbf055fe6f
7 changed files with 94 additions and 101 deletions
+6 -4
View File
@@ -51,13 +51,15 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> Result<()> {
let platform = Platform::current()?;
let venv = Virtualenv::from_env(platform, &cache)?;
let client = RegistryClientBuilder::new(cache.clone()).build();
let index_urls = IndexUrls::default();
let build_dispatch = BuildDispatch::new(
client.clone(),
cache.clone(),
venv.interpreter().clone(),
&client,
&cache,
venv.interpreter(),
&index_urls,
venv.python_executable(),
args.no_build,
IndexUrls::default(),
);
// Copied from `BuildDispatch`