Skip to content

Commit

Permalink
fix: Adding Clone derive macro to internal model (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandxy89 committed Jan 5, 2024
1 parent 6f43062 commit ee5799e
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/model/coefficient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
Rule,
};

#[derive(Debug)]
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Coefficient {
pub var_name: String,
Expand Down
2 changes: 1 addition & 1 deletion src/model/constraint.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{coefficient::Coefficient, sos::SOSClass};

#[derive(Debug)]
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Constraint {
/// Standard LP constraint
Expand Down
2 changes: 1 addition & 1 deletion src/model/lp_problem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::{hash_map::Entry, HashMap};

use crate::model::{constraint::Constraint, objective::Objective, sense::Sense, variable::VariableType};

#[derive(Debug, Default, PartialEq, Eq)]
#[derive(Debug, Default, PartialEq, Eq, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct LPProblem {
pub problem_name: String,
Expand Down
2 changes: 1 addition & 1 deletion src/model/objective.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::model::coefficient::Coefficient;

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Objective {
pub name: String,
Expand Down
2 changes: 1 addition & 1 deletion src/model/sense.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Debug, Default, PartialEq, Eq)]
#[derive(Debug, Default, PartialEq, Eq, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Sense {
#[default]
Expand Down
2 changes: 1 addition & 1 deletion src/model/sos.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::str::FromStr;

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum SOSClass {
S1,
Expand Down
2 changes: 1 addition & 1 deletion src/model/variable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::Rule;

#[derive(Debug, Default)]
#[derive(Debug, Default, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
/// A enum representing the bounds of a variable
pub enum VariableType {
Expand Down

0 comments on commit ee5799e

Please sign in to comment.