Skip to content

Commit d45e12b

Browse files
committed
Version bump
1 parent 80cce53 commit d45e12b

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stl_io"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
authors = ["Henning Meyer <tutmann@gmail.com>"]
55
edition = "2018"
66

@@ -16,7 +16,7 @@ path = "src/lib.rs"
1616

1717
[dependencies]
1818
byteorder = "1"
19-
float-cmp = "0.8"
19+
float-cmp = "0.9"
2020

2121
[badges]
2222
travis-ci = { repository = "hmeyer/stl_io", branch = "master" }

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
format_strings = false
1+
#format_strings = false
22
reorder_imports = true

src/lib.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
//extern crate byteorder;
3838

3939
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
40-
use float_cmp::{ApproxEq, F32Margin};
40+
use float_cmp::ApproxEq;
41+
use std::collections::HashMap;
4142
use std::io::{BufRead, BufReader, BufWriter};
4243
use std::io::{Read, Result, Write};
4344
use std::iter::Iterator;
44-
use std::collections::HashMap;
4545

4646
/// Float Vector with approx_eq.
4747
#[derive(Default, Clone, Copy, Debug, PartialEq, PartialOrd)]
@@ -134,10 +134,7 @@ impl IndexedMesh {
134134
if area < f32::EPSILON {
135135
return Err(::std::io::Error::new(
136136
::std::io::ErrorKind::InvalidData,
137-
format!(
138-
"face #{} has a zero-area face",
139-
fi
140-
),
137+
format!("face #{} has a zero-area face", fi),
141138
));
142139
}
143140
}
@@ -159,9 +156,7 @@ impl IndexedMesh {
159156
::std::io::ErrorKind::InvalidData,
160157
format!(
161158
"did not find facing edge for face #{}, edge #v{} -> #v{}",
162-
fi,
163-
i1,
164-
i2
159+
fi, i1, i2
165160
),
166161
))
167162
} else {
@@ -260,7 +255,7 @@ where
260255

261256
/// Struct for binary STL reader.
262257
pub struct BinaryStlReader<'a> {
263-
reader: Box<dyn::std::io::Read + 'a>,
258+
reader: Box<dyn ::std::io::Read + 'a>,
264259
index: usize,
265260
size: usize,
266261
}
@@ -367,7 +362,7 @@ pub trait TriangleIterator: ::std::iter::Iterator<Item = Result<Triangle>> {
367362

368363
/// Struct for ascii STL reader.
369364
pub struct AsciiStlReader<'a> {
370-
lines: Box<dyn::std::iter::Iterator<Item = Result<Vec<String>>> + 'a>,
365+
lines: Box<dyn ::std::iter::Iterator<Item = Result<Vec<String>>> + 'a>,
371366
}
372367

373368
impl<'a> TriangleIterator for BinaryStlReader<'a> {}
@@ -543,6 +538,8 @@ fn tri_area(a: Vertex, b: Vertex, c: Vertex) -> f32 {
543538
#[cfg(test)]
544539
mod test {
545540
use super::*;
541+
use float_cmp::F32Margin;
542+
546543
const BUNNY_99: &[u8] = include_bytes!("testdata/bunny_99.stl");
547544
const BUNNY_99_ASCII: &[u8] = include_bytes!("testdata/bunny_99_ascii.stl");
548545

@@ -813,8 +810,8 @@ mod test {
813810

814811
#[test]
815812
fn simple_tri_area() {
816-
let a = Vector::new([-1.0, 1.0, 0.0]);
817-
let b = Vector::new([ 1.0, -1.0, 0.0]);
813+
let a = Vector::new([-1.0, 1.0, 0.0]);
814+
let b = Vector::new([1.0, -1.0, 0.0]);
818815
let c = Vector::new([-1.0, -1.0, 0.0]);
819816
let area = tri_area(a, b, c);
820817
assert_eq!(area, 2.0);

0 commit comments

Comments
 (0)