Clippy cleanup and module visibility cleanup.

This commit is contained in:
Bill Thiede 2018-09-08 20:19:46 -07:00
parent b8861b7f8d
commit cdd2d585a7

View File

@ -9,9 +9,9 @@ use std::str;
#[derive(Default, Debug, PartialEq, Copy, Clone)]
pub struct Vec3 {
x: f32,
y: f32,
z: f32,
pub x: f32,
pub y: f32,
pub z: f32,
}
pub fn cross(v1: Vec3, v2: Vec3) -> Vec3 {
@ -62,7 +62,7 @@ impl fmt::Display for Vec3 {
impl str::FromStr for Vec3 {
type Err = ParseFloatError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let coords: Vec<&str> = s.split(" ").collect();
let coords: Vec<&str> = s.split(' ').collect();
Ok(Vec3 {
x: coords[0].parse::<f32>()?,
y: coords[1].parse::<f32>()?,