uv-resolver: add Clone impls

For $reasons, we'll want to be able to clone a `Manifest` so
that it can be re-used to generate a marker expression.

There is likely a refactoring that could be done to avoid the
cloning, but a `Manifest` is likely to be small in practice, and
we'll only need to clone it once.
This commit is contained in:
Andrew Gallant
2024-03-22 13:15:46 -04:00
committed by Andrew Gallant
parent b177bd026d
commit 50e48847f1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ use uv_normalize::PackageName;
use crate::preferences::Preference;
/// A manifest of requirements, constraints, and preferences.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Manifest {
pub(crate) requirements: Vec<Requirement>,
pub(crate) constraints: Vec<Requirement>,
+1 -1
View File
@@ -19,7 +19,7 @@ pub enum PreferenceError {
}
/// A pinned requirement, as extracted from a `requirements.txt` file.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Preference {
requirement: Requirement,
hashes: Vec<Hashes>,