mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
fix unreported clippy warnings
This commit is contained in:
parent
7ea268a5d1
commit
ed3e1ad356
1 changed files with 2 additions and 4 deletions
|
@ -51,17 +51,15 @@ impl<T> RocList<T> {
|
||||||
pub fn get(&self, index: usize) -> Option<&T> {
|
pub fn get(&self, index: usize) -> Option<&T> {
|
||||||
if index < self.len() {
|
if index < self.len() {
|
||||||
Some(unsafe {
|
Some(unsafe {
|
||||||
let raw = self.elements.offset(index as isize);
|
let raw = self.elements.add(index);
|
||||||
let reference = core::mem::transmute::<*mut T, &T>(raw);
|
|
||||||
|
|
||||||
reference
|
&*raw
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#[no_mangle]
|
|
||||||
pub fn storage(&self) -> Option<Storage> {
|
pub fn storage(&self) -> Option<Storage> {
|
||||||
use core::cmp::Ordering::*;
|
use core::cmp::Ordering::*;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue