Skip to content

Commit

Permalink
Update readme example with current API
Browse files Browse the repository at this point in the history
Fixes #32
  • Loading branch information
elrnv committed Jun 8, 2023
1 parent 8b31337 commit 83d7d2a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@ Below we load a VTK file named `tet.vtk`, modify it and write it back in Legacy

```rust
use vtkio::model::*; // import model definition of a VTK file
use vtkio::{import, export_ascii};
fn main() {
use std::path::PathBuf;
let file_path = PathBuf::from("assets/tet.vtk");

let mut vtk_file = import(&file_path)
let mut vtk_file = Vtk::import(&file_path)
.expect(&format!("Failed to load file: {:?}", file_path));

vtk_file.version = Version::new((4,2)); // arbitrary change

export_ascii(vtk_file, &file_path)
vtk_file.export_ascii(&file_path)
.expect(&format!("Failed to save file: {:?}", file_path));
}
```
Expand Down

0 comments on commit 83d7d2a

Please sign in to comment.