Created
February 26, 2014 20:19
-
-
Save pzol/9237664 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
mod unicode { | |
struct Cluster<'a> { | |
chars: &'a [char] | |
} | |
pub fn unpack<'a>(s: &str) -> &'a [Cluster<'a>] { | |
let mut clusters = ~[]; | |
// let cluster = Cluster { chars: &'static [] }; | |
// clusters.push(cluster); | |
clusters.as_slice() | |
// &'static [&'static [2325, 2381], &'static [2359], &'static [2367]] | |
} | |
} | |
#[test] | |
fn test_unpack(){ | |
use unicode::unpack; | |
// assert_eq!(unpack(""), &[&[2325, 2381], &[2359], &[2367]]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment