Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
nwagner84 committed Sep 18, 2024
1 parent cb229db commit 7bbc51d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/primitives/occurrence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ impl<'a> OccurrenceRef<'a> {
})
}

/// Returns the [OccurrenceRef] as a byte slice.
///
/// # Example
///
/// ```rust
/// use pica_record::primitives::OccurrenceRef;
///
/// let occurrence = OccurrenceRef::from_bytes(b"01")?;
/// assert_eq!(occurrence.as_bytes(), b"01");
///
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
#[inline]
pub fn as_bytes(&self) -> &[u8] {
self.0
Expand Down Expand Up @@ -137,6 +149,7 @@ impl<T: AsRef<[u8]>> PartialEq<T> for OccurrenceRef<'_> {
/// A mutable occurrence.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[allow(clippy::len_without_is_empty)]
pub struct Occurrence(BString);

impl Occurrence {
Expand Down

0 comments on commit 7bbc51d

Please sign in to comment.