Skip to content

Commit

Permalink
removes len and is_empty from PointerBuf
Browse files Browse the repository at this point in the history
  • Loading branch information
chanced committed Oct 1, 2024
1 parent 931fe05 commit a5ec76c
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,35 +832,6 @@ impl PointerBuf {
self
}

// Returns the length of `self` in encoded format.
///
/// This length expresses the byte count of the underlying string that
/// represents the RFC 6091 Pointer. See also [`std::str::len`].
///
/// ## Examples
/// ```
/// let ptr = jsonptr::Pointer::from_static("/foo/bar");
/// assert_eq!(ptr.len(), 8);
///
/// ```
pub fn len(&self) -> usize {
self.0.len()
}

/// Returns `true` if the `Pointer` is empty (i.e. root).
///
/// ## Examples
/// ```
/// let mut ptr = jsonptr::PointerBuf::new();
/// assert!(ptr.is_empty());
///
/// ptr.push_back("foo");
/// assert!(!ptr.is_empty());
/// ```
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}

/// Pushes a `Token` onto the front of this `Pointer`.
pub fn push_front<'t>(&mut self, token: impl Into<Token<'t>>) {
self.0.insert(0, '/');
Expand Down

0 comments on commit a5ec76c

Please sign in to comment.