MCPcopy Create free account
hub / github.com/chanced/jsonptr / append

Method append

src/pointer.rs:991–999  ·  view source on GitHub ↗

Merges two `Pointer`s by appending `other` onto `self`.

(&mut self, other: P)

Source from the content-addressed store, hash-verified

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.

Callers 3

concatMethod · 0.80
qc_intersectionFunction · 0.80
intersectionFunction · 0.80

Calls 2

as_refMethod · 0.80
is_rootMethod · 0.80

Tested by 1

intersectionFunction · 0.64