Skip to content

Commit

Permalink
Remove dead code rustc warns about
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Mar 17, 2020
1 parent 8acf1b6 commit 5239081
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/graphics/drawparam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use crate::graphics::*;

use mint;

type Vec3 = na::Vector3<f32>;

/// A struct containing all the necessary info for drawing a [`Drawable`](trait.Drawable.html).
///
/// This struct implements the `Default` trait, so to set only some parameter
Expand Down Expand Up @@ -111,6 +109,7 @@ impl DrawParam {
/// A [`DrawParam`](struct.DrawParam.html) that has been crunched down to a single matrix.
fn to_na_matrix(&self) -> Matrix4 {
// Calculate a matrix equivalent to doing this:
// type Vec3 = na::Vector3<f32>;
// let translate = Matrix4::new_translation(&Vec3::new(self.dest.x, self.dest.y, 0.0));
// let offset = Matrix4::new_translation(&Vec3::new(self.offset.x, self.offset.y, 0.0));
// let offset_inverse =
Expand Down
1 change: 0 additions & 1 deletion src/graphics/types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub(crate) use nalgebra as na;
use std::f32;
use std::u32;
use serde::{Serialize, Deserialize};

use crate::graphics::{FillOptions, StrokeOptions};

Expand Down
6 changes: 3 additions & 3 deletions src/tests/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ fn test_monospace_text_is_actually_monospace() {
let font = graphics::Font::new(ctx, "/DejaVuSansMono.ttf").unwrap();

let text1 = graphics::Text::new(("Hello 1", font, 24.0));
let text2 = graphics::Text::new(("Hello 2", font, 24.0));;
let text3 = graphics::Text::new(("Hello 3", font, 24.0));;
let text4 = graphics::Text::new(("Hello 4", font, 24.0));;
let text2 = graphics::Text::new(("Hello 2", font, 24.0));
let text3 = graphics::Text::new(("Hello 3", font, 24.0));
let text4 = graphics::Text::new(("Hello 4", font, 24.0));

let width1 = text1.width(ctx);
let width2 = text3.width(ctx);
Expand Down

0 comments on commit 5239081

Please sign in to comment.