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:
committed by
Andrew Gallant
parent
b177bd026d
commit
50e48847f1
@@ -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>,
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user