(&self)
| 147 | } |
| 148 | |
| 149 | fn min(&self) -> (Option<&T>, Option<&U>) { |
| 150 | // 最小值一定在最左侧 |
| 151 | match &self.left { |
| 152 | Some(node) => node.min(), |
| 153 | None => match &self.key { |
| 154 | Some(key) => (Some(&key), self.val.as_ref()), |
| 155 | None => (None, None), |
| 156 | }, |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | fn max(&self) -> (Option<&T>, Option<&U>) { |
| 161 | // 最大值一定在最右侧 |
no outgoing calls
no test coverage detected