projects
/
mandelwow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a clippy warning about superfluous match references
[mandelwow.git]
/
bounding_box.rs
diff --git
a/bounding_box.rs
b/bounding_box.rs
index 71cee762518b0c1e0e107c79ea88d7458d5ce1af..6625eb546182a45b6e265d899300943fb00d0e2c 100644
(file)
--- a/
bounding_box.rs
+++ b/
bounding_box.rs
@@
-2,6
+2,7
@@
use crate::cube::Cube;
use glium;
use glium::{Display, Program, Surface, implement_vertex};
use glium::index::{IndexBuffer, PrimitiveType};
use glium;
use glium::{Display, Program, Surface, implement_vertex};
use glium::index::{IndexBuffer, PrimitiveType};
+use std::rc::Rc;
pub fn solid_fill_program(display: &Display) -> Program {
let vertex_shader_src = include_str!("shaders/solid.vert");
pub fn solid_fill_program(display: &Display) -> Program {
let vertex_shader_src = include_str!("shaders/solid.vert");
@@
-13,14
+14,14
@@
pub fn solid_fill_program(display: &Display) -> Program {
struct Vertex { position: [f32; 3] }
implement_vertex!(Vertex, position);
struct Vertex { position: [f32; 3] }
implement_vertex!(Vertex, position);
-pub struct BoundingBox
<'a>
{
+pub struct BoundingBox {
vertexes: glium::VertexBuffer<Vertex>,
vertexes: glium::VertexBuffer<Vertex>,
- program:
&'a Program
,
+ program:
Rc<Program>
,
indices: IndexBuffer<u16>,
}
indices: IndexBuffer<u16>,
}
-impl
<'a> BoundingBox<'a>
{
- pub fn new(display: &Display, c: &Cube, program:
&'a Program) -> BoundingBox<'a>
{
+impl
BoundingBox
{
+ pub fn new(display: &Display, c: &Cube, program:
Rc<Program>) -> BoundingBox
{
let vertex_data = [
Vertex { position: [c.xmin, c.ymin, c.zmin] },
Vertex { position: [c.xmax, c.ymin, c.zmin] },
let vertex_data = [
Vertex { position: [c.xmin, c.ymin, c.zmin] },
Vertex { position: [c.xmax, c.ymin, c.zmin] },
@@
-54,6
+55,6
@@
impl<'a> BoundingBox<'a> {
blend: glium::Blend::alpha_blending(),
..Default::default()
};
blend: glium::Blend::alpha_blending(),
..Default::default()
};
- frame.draw(&self.vertexes, &self.indices, self.program, uniforms, ¶ms).unwrap();
+ frame.draw(&self.vertexes, &self.indices,
&
self.program, uniforms, ¶ms).unwrap();
}
}
}
}