Created
June 12, 2014 02:24
-
-
Save j16r/9100eeb5d6467070db03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Queue<T, size> { | |
items : [T] | |
} | |
impl<T, size> Queue<T, size> { | |
pub fn new() -> Queue<T, size> { | |
Queue { items : [T, ..size] } | |
} | |
} | |
#[test] | |
pub fn test_queue() { | |
type SmallU8Queue = Queue<uint, 10>; | |
let q = SmallU8Queue::new(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment