Merges two `Pointer`s by appending `other` onto `self`.
(&mut self, other: P)
| 989 | |
| 990 | /// Merges two `Pointer`s by appending `other` onto `self`. |
| 991 | pub fn append<P: AsRef<Pointer>>(&mut self, other: P) -> &PointerBuf { |
| 992 | let other = other.as_ref(); |
| 993 | if self.is_root() { |
| 994 | self.0 = other.0.to_string(); |
| 995 | } else if !other.is_root() { |
| 996 | self.0.push_str(&other.0); |
| 997 | } |
| 998 | self |
| 999 | } |
| 1000 | |
| 1001 | /// Attempts to replace a `Token` by the index, returning the replaced |
| 1002 | /// `Token` if it already exists. Returns `None` otherwise. |