Skip to content

Commit 9398283

Browse files
authoredFeb 10, 2025··
Merge pull request #214 from scipopt/remove-last-rc
Update scip-sys, remove usage of Rc
2 parents b567bff + eb86f44 commit 9398283

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed
 

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bundled = ["scip-sys/bundled"]
1313
from-source = ["scip-sys/from-source"]
1414

1515
[dependencies]
16-
scip-sys = "0.1.18"
16+
scip-sys = "0.1.20"
1717

1818
[dev-dependencies]
1919
rayon = "1.5.1"

‎src/model.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -382,17 +382,16 @@ impl Model<Solving> {
382382
obj: f64,
383383
name: &str,
384384
var_type: VarType,
385-
) -> Rc<Variable> {
385+
) -> Variable {
386386
let var = self
387387
.scip
388388
.create_var_solving(lb, ub, obj, name, var_type)
389389
.expect("Failed to create variable in state ProblemCreated");
390-
let var = Variable {
390+
391+
Variable {
391392
raw: var,
392393
scip: self.scip.clone(),
393-
};
394-
395-
Rc::new(var)
394+
}
396395
}
397396

398397
/// Returns the current node of the model.
@@ -445,17 +444,16 @@ impl Model<Solving> {
445444
obj: f64,
446445
name: &str,
447446
var_type: VarType,
448-
) -> Rc<Variable> {
447+
) -> Variable {
449448
let var = self
450449
.scip
451450
.create_priced_var(lb, ub, obj, name, var_type)
452451
.expect("Failed to create variable in state ProblemCreated");
453-
let var = Variable {
452+
453+
Variable {
454454
raw: var,
455455
scip: self.scip.clone(),
456-
};
457-
458-
Rc::new(var)
456+
}
459457
}
460458

461459
/// Gets the variable in current problem given its index (in the problem).

0 commit comments

Comments
 (0)
Please sign in to comment.