Skip to content

Commit

Permalink
Add missing AsRef impl (valence-rs#552)
Browse files Browse the repository at this point in the history
# Objective

- Add missing `AsRef` impl for `JavaStr`.

# Solution

- `str` has the same thing.
  • Loading branch information
Earthcomputer authored and SelfMadeSystem committed Oct 12, 2023
1 parent f233204 commit 5b192f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/java_string/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,13 @@ impl AsRef<JavaStr> for String {
}
}

impl AsRef<JavaStr> for JavaStr {
#[inline]
fn as_ref(&self) -> &JavaStr {
self
}
}

impl Clone for Box<JavaStr> {
#[inline]
fn clone(&self) -> Self {
Expand Down

0 comments on commit 5b192f3

Please sign in to comment.