mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
final touchups
This commit is contained in:
parent
0a2e7be885
commit
a9329b250d
2 changed files with 1 additions and 5 deletions
|
@ -5,7 +5,7 @@ authors = ["Richard Feldman <oss@rtfeldman.com>"]
|
||||||
repository = "https://github.com/rtfeldman/roc"
|
repository = "https://github.com/rtfeldman/roc"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Generate LLVM bitcode for Roc builtins"
|
description = "Rust representations of Roc data structures"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -34,17 +34,14 @@ pub enum Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> RocList<T> {
|
impl<T> RocList<T> {
|
||||||
#[no_mangle]
|
|
||||||
pub fn len(&self) -> usize {
|
pub fn len(&self) -> usize {
|
||||||
self.length
|
self.length
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub fn is_empty(&self) -> bool {
|
pub fn is_empty(&self) -> bool {
|
||||||
self.length == 0
|
self.length == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub fn empty() -> Self {
|
pub fn empty() -> Self {
|
||||||
RocList {
|
RocList {
|
||||||
length: 0,
|
length: 0,
|
||||||
|
@ -52,7 +49,6 @@ impl<T> RocList<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue