Skip to content

Instantly share code, notes, and snippets.

@pzol
Created February 26, 2014 20:19
Show Gist options
  • Save pzol/9237664 to your computer and use it in GitHub Desktop.
Save pzol/9237664 to your computer and use it in GitHub Desktop.
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