Method
match_segment
(
&self,
user: &FPUser,
predicate: &str,
segment_repo: Option<&HashMap<String, Segment>>,
)
Source from the content-addressed store, hash-verified
| 450 | } |
| 451 | |
| 452 | fn match_segment( |
| 453 | &self, |
| 454 | user: &FPUser, |
| 455 | predicate: &str, |
| 456 | segment_repo: Option<&HashMap<String, Segment>>, |
| 457 | ) -> bool { |
| 458 | match segment_repo { |
| 459 | None => false, |
| 460 | Some(repo) => match predicate { |
| 461 | "is in" => self.user_in_segments(user, repo), |
| 462 | "is not in" => !self.user_in_segments(user, repo), |
| 463 | _ => false, |
| 464 | }, |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | fn match_string(&self, user: &FPUser, predicate: &str) -> bool { |
| 469 | if let Some(c) = user.get(&self.subject) { |
Tested by
no test coverage detected