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

Method ends_with

src/pointer.rs:282–285  ·  view source on GitHub ↗

Returns whether `self` has a suffix of `other`. Note that `Pointer::root` is only a valid suffix of itself.

(&self, other: &Self)

Source from the content-addressed store, hash-verified

280 ///
281 /// Note that `Pointer::root` is only a valid suffix of itself.
282 pub fn ends_with(&self, other: &Self) -> bool {
283 (self.is_root() && other.is_root())
284 || (!other.is_root() && self.as_str().ends_with(&other.0))
285 }
286
287 /// Returns whether `self` has a prefix of `other.`
288 ///

Callers

nothing calls this directly

Calls 2

is_rootMethod · 0.80
as_strMethod · 0.80

Tested by

no test coverage detected