(node: Option<NonNull<Self>>)
| 87 | } |
| 88 | |
| 89 | pub fn sibling(node: Option<NonNull<Self>>) -> Option<NonNull<Self>> { |
| 90 | unsafe { |
| 91 | node.and_then(|node| { |
| 92 | node.as_ref().parent.and_then(|parent| { |
| 93 | if parent.as_ref().left == Some(node) { |
| 94 | parent.as_ref().right |
| 95 | } else { |
| 96 | parent.as_ref().left |
| 97 | } |
| 98 | }) |
| 99 | }) |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | pub fn uncle(node: Option<NonNull<Self>>) -> Option<NonNull<Self>> { |
| 104 | unsafe { |
nothing calls this directly
no outgoing calls
no test coverage detected