Skip to content

Commit

Permalink
Bump data-buffer dependency version to 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
elrnv committed Mar 5, 2019
1 parent e12add2 commit 0df3e0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vtkio"
version = "0.1.6"
version = "0.1.7"
authors = ["Egor Larionov <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Parser and writer for the legacy VTK file format"
Expand All @@ -23,7 +23,7 @@ nom = { version = "3", features = ["verbose-errors"] }
num-traits = "0.2"
enum-primitive-derive = "^0.1"
byteorder = "1.2"
data-buffer = { version = "0.4", features = ["numeric"] }
data-buffer = { version = "0.5", features = ["numeric"] }

[dev-dependencies]
rand = "0.5"
Expand Down
28 changes: 14 additions & 14 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mod write_vtk_impl {
self,
"SCALARS {} {} {}\n",
name,
DataType::from(data.type_id()),
DataType::from(data.element_type_id()),
num_comp
).expect("Error writing a Scalars attribute header.");
write!(
Expand All @@ -73,7 +73,7 @@ mod write_vtk_impl {
self,
"VECTORS {} {}\n",
name,
DataType::from(data.type_id())
DataType::from(data.element_type_id())
).expect("Error writing a Vectors attribute header.");
self.write_buf::<BO>(data, "Error writing Vectors attribute data.");
}
Expand All @@ -82,7 +82,7 @@ mod write_vtk_impl {
self,
"NORMALS {} {}\n",
name,
DataType::from(data.type_id())
DataType::from(data.element_type_id())
).expect("Error writing a Normals attribute header.");
self.write_buf::<BO>(data, "Error writing Normals attribute data.");
}
Expand All @@ -92,7 +92,7 @@ mod write_vtk_impl {
"TEXTURE_COORDINATES {} {} {}\n",
name,
dim,
DataType::from(data.type_id())
DataType::from(data.element_type_id())
).expect("Error writing a TextureCoordinates attribute header.");
self.write_buf::<BO>(
data,
Expand All @@ -104,7 +104,7 @@ mod write_vtk_impl {
self,
"TENSORS {} {}\n",
name,
DataType::from(data.type_id())
DataType::from(data.element_type_id())
).expect("Error writing a Tensors attribute header.");
self.write_buf::<BO>(data, "Error writing Tensors attribute data.");
}
Expand All @@ -118,7 +118,7 @@ mod write_vtk_impl {
field.name,
field.num_comp,
field.data.len() / field.num_comp as usize,
DataType::from(field.data.type_id())
DataType::from(field.data.element_type_id())
).expect("Error writing Field attribute array header.");
self.write_buf::<BO>(
field.data,
Expand All @@ -145,7 +145,7 @@ mod write_vtk_impl {
field.name,
field.num_comp,
field.data.len() / field.num_comp as usize,
DataType::from(field.data.type_id())
DataType::from(field.data.element_type_id())
).expect("Error writing Field array data header.");
self.write_buf::<BO>(
field.data,
Expand All @@ -161,7 +161,7 @@ mod write_vtk_impl {
self,
"POINTS {} {}\n",
points.len() / 3,
DataType::from(points.type_id())
DataType::from(points.element_type_id())
).expect("Error writing PolyData points.");
let num_points = points.len() / 3;
self.write_buf::<BO>(points, "Error writing PolyData points.");
Expand Down Expand Up @@ -211,7 +211,7 @@ mod write_vtk_impl {
self,
"POINTS {} {}\n",
points.len() / 3,
DataType::from(points.type_id())
DataType::from(points.element_type_id())
).expect("Error writing UnstructuredGrid points.");
let num_points = points.len() / 3;
self.write_buf::<BO>(points, "Error writing UnstructuredGrid points.");
Expand Down Expand Up @@ -275,7 +275,7 @@ mod write_vtk_impl {
self,
"POINTS {} {}\n",
points.len() / 3,
DataType::from(points.type_id())
DataType::from(points.element_type_id())
).expect("Error writing StructuredGrid points.");
let num_points = points.len() / 3;
self.write_buf::<BO>(points, "Error writing StructuredGrid points.");
Expand All @@ -301,23 +301,23 @@ mod write_vtk_impl {
self,
"X_COORDINATES {} {}\n",
x_coords.len(),
DataType::from(x_coords.type_id())
DataType::from(x_coords.element_type_id())
).expect("Error writing RectilinearGrid x_coordinates.");
let num_x_coords = x_coords.len();
self.write_buf::<BO>(x_coords, "Error writing RectilinearGrid x_coordinates.");
write!(
self,
"Y_COORDINATES {} {}\n",
y_coords.len(),
DataType::from(y_coords.type_id())
DataType::from(y_coords.element_type_id())
).expect("Error writing RectilinearGrid y_coordinates.");
let num_y_coords = y_coords.len();
self.write_buf::<BO>(y_coords, "Error writing RectilinearGrid y_coordinates.");
write!(
self,
"Z_COORDINATES {} {}\n",
z_coords.len(),
DataType::from(z_coords.type_id())
DataType::from(z_coords.element_type_id())
).expect("Error writing RectilinearGrid z_coordinates.");
let num_z_coords = z_coords.len();
self.write_buf::<BO>(z_coords, "Error writing RectilinearGrid z_coordinates.");
Expand Down Expand Up @@ -365,7 +365,7 @@ mod write_vtk_impl {
}
}

match buf.type_id() {
match buf.element_type_id() {
x if x == TypeId::of::<u8>() => write_buf_impl(buf, self, Self::write_u8, err),
x if x == TypeId::of::<i8>() => write_buf_impl(buf, self, Self::write_i8, err),
x if x == TypeId::of::<u16>() => {
Expand Down

0 comments on commit 0df3e0a

Please sign in to comment.