mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
clippy
This commit is contained in:
parent
75e996c445
commit
11cccde050
6 changed files with 22 additions and 22 deletions
|
@ -154,7 +154,7 @@ impl RocStr {
|
|||
/// bytes over - in other words, calling this `as_str` method and then calling `to_string`
|
||||
/// on that.
|
||||
pub fn as_str(&self) -> &str {
|
||||
&*self
|
||||
self
|
||||
}
|
||||
|
||||
/// Create an empty RocStr with enough space preallocated to store
|
||||
|
@ -562,8 +562,8 @@ impl Deref for RocStr {
|
|||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
match self.as_enum_ref() {
|
||||
RocStrInnerRef::HeapAllocated(h) => unsafe { core::str::from_utf8_unchecked(&*h) },
|
||||
RocStrInnerRef::SmallString(s) => &*s,
|
||||
RocStrInnerRef::HeapAllocated(h) => unsafe { core::str::from_utf8_unchecked(h) },
|
||||
RocStrInnerRef::SmallString(s) => s,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue