• Home
  • Raw
  • Download

Lines Matching full:cmp

4     for cmp in &req.comparators {  in matches_req()
5 if !matches_impl(cmp, ver) { in matches_req()
17 for cmp in &req.comparators { in matches_req()
18 if pre_is_compatible(cmp, ver) { in matches_req()
26 pub(crate) fn matches_comparator(cmp: &Comparator, ver: &Version) -> bool { in matches_comparator()
27 matches_impl(cmp, ver) && (ver.pre.is_empty() || pre_is_compatible(cmp, ver)) in matches_comparator()
30 fn matches_impl(cmp: &Comparator, ver: &Version) -> bool { in matches_impl()
31 match cmp.op { in matches_impl()
32 Op::Exact | Op::Wildcard => matches_exact(cmp, ver), in matches_impl()
33 Op::Greater => matches_greater(cmp, ver), in matches_impl()
34 Op::GreaterEq => matches_exact(cmp, ver) || matches_greater(cmp, ver), in matches_impl()
35 Op::Less => matches_less(cmp, ver), in matches_impl()
36 Op::LessEq => matches_exact(cmp, ver) || matches_less(cmp, ver), in matches_impl()
37 Op::Tilde => matches_tilde(cmp, ver), in matches_impl()
38 Op::Caret => matches_caret(cmp, ver), in matches_impl()
44 fn matches_exact(cmp: &Comparator, ver: &Version) -> bool { in matches_exact()
45 if ver.major != cmp.major { in matches_exact()
49 if let Some(minor) = cmp.minor { in matches_exact()
55 if let Some(patch) = cmp.patch { in matches_exact()
61 ver.pre == cmp.pre in matches_exact()
64 fn matches_greater(cmp: &Comparator, ver: &Version) -> bool { in matches_greater()
65 if ver.major != cmp.major { in matches_greater()
66 return ver.major > cmp.major; in matches_greater()
69 match cmp.minor { in matches_greater()
78 match cmp.patch { in matches_greater()
87 ver.pre > cmp.pre in matches_greater()
90 fn matches_less(cmp: &Comparator, ver: &Version) -> bool { in matches_less()
91 if ver.major != cmp.major { in matches_less()
92 return ver.major < cmp.major; in matches_less()
95 match cmp.minor { in matches_less()
104 match cmp.patch { in matches_less()
113 ver.pre < cmp.pre in matches_less()
116 fn matches_tilde(cmp: &Comparator, ver: &Version) -> bool { in matches_tilde()
117 if ver.major != cmp.major { in matches_tilde()
121 if let Some(minor) = cmp.minor { in matches_tilde()
127 if let Some(patch) = cmp.patch { in matches_tilde()
133 ver.pre >= cmp.pre in matches_tilde()
136 fn matches_caret(cmp: &Comparator, ver: &Version) -> bool { in matches_caret()
137 if ver.major != cmp.major { in matches_caret()
141 let minor = match cmp.minor { in matches_caret()
146 let patch = match cmp.patch { in matches_caret()
148 if cmp.major > 0 { in matches_caret()
157 if cmp.major > 0 { in matches_caret()
173 ver.pre >= cmp.pre in matches_caret()
176 fn pre_is_compatible(cmp: &Comparator, ver: &Version) -> bool { in pre_is_compatible()
177 cmp.major == ver.major in pre_is_compatible()
178 && cmp.minor == Some(ver.minor) in pre_is_compatible()
179 && cmp.patch == Some(ver.patch) in pre_is_compatible()
180 && !cmp.pre.is_empty() in pre_is_compatible()