Skip to content

Commit

Permalink
📝 Enhance documentation comment for EntryName and EntryReference
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune committed Aug 11, 2024
1 parent e962cf7 commit 432b3c2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/src/entry/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ impl PartialEq<str> for EntryName {
}

impl PartialEq<&str> for EntryName {
/// # Examples
///
/// ```
/// use libpna::EntryName;
///
/// assert_eq!(EntryName::from("test.txt"), "test.txt");
/// ```
#[inline]
fn eq(&self, other: &&str) -> bool {
PartialEq::eq(self.as_str(), *other)
Expand All @@ -231,6 +238,13 @@ impl PartialEq<EntryName> for str {
}

impl PartialEq<EntryName> for &str {
/// # Examples
///
/// ```
/// use libpna::EntryName;
///
/// assert_eq!("test.txt", EntryName::from("test.txt"));
/// ```
#[inline]
fn eq(&self, other: &EntryName) -> bool {
PartialEq::eq(self, &other.as_str())
Expand Down
14 changes: 14 additions & 0 deletions lib/src/entry/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ impl PartialEq<str> for EntryReference {
}

impl PartialEq<&str> for EntryReference {
/// # Examples
///
/// ```
/// use libpna::EntryReference;
///
/// assert_eq!(EntryReference::from("test.txt"), "test.txt");
/// ```
#[inline]
fn eq(&self, other: &&str) -> bool {
PartialEq::eq(self.as_str(), *other)
Expand All @@ -232,6 +239,13 @@ impl PartialEq<EntryReference> for str {
}

impl PartialEq<EntryReference> for &str {
/// # Examples
///
/// ```
/// use libpna::EntryReference;
///
/// assert_eq!("test.txt", EntryReference::from("test.txt"));
/// ```
#[inline]
fn eq(&self, other: &EntryReference) -> bool {
PartialEq::eq(self, &other.as_str())
Expand Down

0 comments on commit 432b3c2

Please sign in to comment.