mirror of
https://github.com/georust/netcdf.git
synced 2026-01-25 15:02:13 +00:00
Added documentation
This commit is contained in:
parent
3c0fbf4007
commit
3649d4cd35
@ -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
|
||||
|
||||
@ -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 );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user