Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/cheetah_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ impl From<&String> for CheetahString {
}
}

impl Borrow<str> for CheetahString {
fn borrow(&self) -> &str {
self.as_str()
}
}
Comment on lines +204 to +208
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove duplicate implementation of Borrow<str>

There's an identical implementation of Borrow<str> for CheetahString later in the file. This duplicate implementation should be removed to maintain code clarity and prevent potential confusion.

-impl Borrow<str> for CheetahString {
-    fn borrow(&self) -> &str {
-        self.as_str()
-    }
-}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
impl Borrow<str> for CheetahString {
fn borrow(&self) -> &str {
self.as_str()
}
}


impl CheetahString {
#[inline]
pub fn empty() -> Self {
Expand Down
Loading