lex-lib 0.3.2

Contains simple but usefull stuff for Rust development.
Documentation
//! Vector2 f32.

mod operators;

/// Simple f32 Vector2.
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Vec2f32 {
	/// X value.
	pub x: f32,
	/// Y value.
	pub y: f32
}

impl Vec2f32 {
	/// Creates a new [`Vec2f32`] with x and y defined.
	///
	/// use `default()` for a 0 initialized.
	pub fn new(x: f32, y: f32) -> Self {
		Self{
			x,
			y
		}
	}
	
	/// Puts x into y and y into x
	pub fn flip(&mut self){
		let tmp = self.x;
		self.x = self.y;
		self.y = tmp;
	}
}

impl Default for Vec2f32 {
	/// Creates a new [`Vec2f32`] with x and y initialized with 0.0.
	fn default() -> Self {
		Self{
			x: 0.,
			y: 0.
		}
	}
}