@@ -7,11 +7,7 @@ use lambda::{
77 WindowEvent ,
88 } ,
99 logging,
10- math:: {
11- matrix,
12- matrix:: Matrix ,
13- vector:: Vector ,
14- } ,
10+ math:: matrix:: Matrix ,
1511 render:: {
1612 buffer:: BufferBuilder ,
1713 command:: RenderCommand ,
@@ -43,7 +39,6 @@ use lambda::{
4339 runtime:: start_runtime,
4440 runtimes:: {
4541 application:: ComponentResult ,
46- ApplicationRuntime ,
4742 ApplicationRuntimeBuilder ,
4843 } ,
4944} ;
@@ -156,7 +151,7 @@ impl Component<ComponentResult, String> for ImmediatesExample {
156151
157152 let mut mesh_builder = MeshBuilder :: new ( ) ;
158153 vertices. iter ( ) . for_each ( |vertex| {
159- mesh_builder. with_vertex ( vertex. clone ( ) ) ;
154+ mesh_builder. with_vertex ( * vertex) ;
160155 } ) ;
161156
162157 let mesh = mesh_builder
@@ -216,7 +211,7 @@ impl Component<ComponentResult, String> for ImmediatesExample {
216211
217212 fn on_detach (
218213 & mut self ,
219- render_context : & mut lambda:: render:: RenderContext ,
214+ _render_context : & mut lambda:: render:: RenderContext ,
220215 ) -> Result < ComponentResult , String > {
221216 logging:: info!( "Detaching component" ) ;
222217 return Ok ( ComponentResult :: Success ) ;
@@ -227,13 +222,10 @@ impl Component<ComponentResult, String> for ImmediatesExample {
227222 }
228223
229224 fn on_window_event ( & mut self , event : & WindowEvent ) -> Result < ( ) , String > {
230- match event {
231- WindowEvent :: Resize { width, height } => {
232- self . width = * width;
233- self . height = * height;
234- logging:: info!( "Window resized to {}x{}" , width, height) ;
235- }
236- _ => { }
225+ if let WindowEvent :: Resize { width, height } = event {
226+ self . width = * width;
227+ self . height = * height;
228+ logging:: info!( "Window resized to {}x{}" , width, height) ;
237229 }
238230 return Ok ( ( ) ) ;
239231 }
@@ -249,7 +241,7 @@ impl Component<ComponentResult, String> for ImmediatesExample {
249241
250242 fn on_render (
251243 & mut self ,
252- render_context : & mut lambda:: render:: RenderContext ,
244+ _render_context : & mut lambda:: render:: RenderContext ,
253245 ) -> Vec < lambda:: render:: command:: RenderCommand > {
254246 let camera = SimpleCamera {
255247 position : [ 0.0 , 0.0 , 3.0 ] ,
@@ -281,12 +273,11 @@ impl Component<ComponentResult, String> for ImmediatesExample {
281273 RenderCommand :: BeginRenderPass {
282274 render_pass: self
283275 . render_pass
284- . expect( "Cannot begin the render pass when it doesn't exist." )
285- . clone( ) ,
276+ . expect( "Cannot begin the render pass when it doesn't exist." ) ,
286277 viewport: viewport. clone( ) ,
287278 } ,
288279 RenderCommand :: SetPipeline {
289- pipeline: render_pipeline. clone ( ) ,
280+ pipeline: render_pipeline,
290281 } ,
291282 RenderCommand :: SetViewports {
292283 start_at: 0 ,
@@ -297,11 +288,11 @@ impl Component<ComponentResult, String> for ImmediatesExample {
297288 viewports: vec![ viewport. clone( ) ] ,
298289 } ,
299290 RenderCommand :: BindVertexBuffer {
300- pipeline: render_pipeline. clone ( ) ,
291+ pipeline: render_pipeline,
301292 buffer: 0 ,
302293 } ,
303294 RenderCommand :: Immediates {
304- pipeline: render_pipeline. clone ( ) ,
295+ pipeline: render_pipeline,
305296 offset: 0 ,
306297 bytes: Vec :: from( immediate_data_to_bytes( & ImmediateData {
307298 data: [ 0.0 , 0.0 , 0.0 , 0.0 ] ,
0 commit comments