Skip to content

Commit 20d5f86

Browse files
authored
Derive Clone for Constraint and ProblemVariables (#107)
1 parent cc80ecf commit 20d5f86

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/constraint.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use core::fmt::{Debug, Formatter};
55
use std::ops::{Shl, Shr, Sub};
66

77
/// A constraint represents a single (in)equality that must hold in the solution.
8+
#[derive(Clone)]
89
pub struct Constraint {
910
/// The expression that is constrained to be null or negative
1011
pub(crate) expression: Expression,

src/variable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ pub fn variable() -> VariableDefinition {
371371
/// Each problem has a unique type, which prevents using the variables
372372
/// from one problem inside an other one.
373373
/// Instances of this type should be created exclusively using the [crate::variables!] macro.
374-
#[derive(Default)]
374+
#[derive(Default, Clone)]
375375
pub struct ProblemVariables {
376376
variables: Vec<VariableDefinition>,
377377
initial_count: usize,

0 commit comments

Comments
 (0)