Added documentation

This commit is contained in:
evomassiny 2017-06-20 18:03:06 +02:00
parent 3c0fbf4007
commit 3649d4cd35
2 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,11 @@ let data : Vec<i32> = var.values().unwrap();
for x in 0..(6*12) {
assert_eq!(data[x], x as i32);
}
// You can also fetch a single value from a datasets,
// using a array slice to index it
let first_val: i32 = var.value_at(&[5, 3]).unwrap();
```
## Write Example

View File

@ -76,7 +76,7 @@ fn test_index_fetch() {
let var = file.root.variables.get("data").unwrap();
let first_val: i32 = var.value_at(&[0usize, 0usize]).unwrap();
let other_val: i32 = var.value_at(&[5usize, 3usize]).unwrap();
let other_val: i32 = var.value_at(&[5, 3]).unwrap();
assert_eq!(first_val, 0 as i32);
assert_eq!(other_val, 63 as i32 );