track_caller on solution_value

This commit is contained in:
Guillaume Pinot
2021-09-15 18:20:34 +02:00
committed by Guillaume P
parent 442e542347
commit 609149dc12
+2
View File
@@ -771,6 +771,7 @@ impl BoolVar {
/// assert_eq!(response.status(), CpSolverStatus::Optimal); /// assert_eq!(response.status(), CpSolverStatus::Optimal);
/// assert!(x.solution_value(&response)); /// assert!(x.solution_value(&response));
/// ``` /// ```
#[track_caller]
pub fn solution_value(self, response: &proto::CpSolverResponse) -> bool { pub fn solution_value(self, response: &proto::CpSolverResponse) -> bool {
if self.0 < 0 { if self.0 < 0 {
use std::ops::Not; use std::ops::Not;
@@ -822,6 +823,7 @@ impl IntVar {
/// assert_eq!(response.status(), CpSolverStatus::Optimal); /// assert_eq!(response.status(), CpSolverStatus::Optimal);
/// assert_eq!(42, x.solution_value(&response)); /// assert_eq!(42, x.solution_value(&response));
/// ``` /// ```
#[track_caller]
pub fn solution_value(self, response: &proto::CpSolverResponse) -> i64 { pub fn solution_value(self, response: &proto::CpSolverResponse) -> i64 {
if self.0 < 0 { if self.0 < 0 {
1 - self.not().solution_value(response) 1 - self.not().solution_value(response)