Skip to content

Commit a491fea

Browse files
authored
Merge pull request #475 from remilauzier/master
fix some warnings
2 parents 40dc75d + 46a1d8e commit a491fea

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "piston-examples"
33
version = "0.0.0"
4+
edition = "2018"
45
authors = ["bvssvni <[email protected]>"]
56
keywords = []
67

examples/cube.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn main() {
5656
.unwrap();
5757
window.set_capture_cursor(true);
5858

59-
let ref mut factory = window.factory.clone();
59+
let mut factory = window.factory.clone();
6060

6161
let vertex_data = vec![
6262
//top (0, 0, 1)
@@ -147,7 +147,7 @@ fn main() {
147147
);
148148

149149
let mut data = pipe::Data {
150-
vbuf: vbuf.clone(),
150+
vbuf,
151151
u_model_view_proj: [[0.0; 4]; 4],
152152
t_color: (texture_view, factory.create_sampler(sinfo)),
153153
out_color: window.output_color.clone(),
@@ -171,7 +171,7 @@ fn main() {
171171
window.encoder.draw(&slice, &pso, &data);
172172
});
173173

174-
if let Some(_) = e.resize_args() {
174+
if e.resize_args().is_some() {
175175
projection = get_projection(&window);
176176
data.out_color = window.output_color.clone();
177177
data.out_depth = window.output_stencil.clone();

examples/multi_window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn create_window(number: usize) -> PistonWindow {
88
}
99

1010
fn main() {
11-
let mut windows: Vec<_> = (0..3 as usize).into_iter().map(|n|
11+
let mut windows: Vec<_> = (0..3_usize).into_iter().map(|n|
1212
create_window(n).position([100 + n as i32 * 300, 100])).collect();
1313
let colors = vec![[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0]];
1414

examples/paint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn main() {
3030
let mut last_pos: Option<[f64; 2]> = None;
3131

3232
while let Some(e) = window.next() {
33-
if let Some(_) = e.render_args() {
33+
if e.render_args().is_some() {
3434
texture.update(&mut texture_context, &canvas).unwrap();
3535
window.draw_2d(&e, |c, g, device| {
3636
// Update texture before rendering.

examples/sprite.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn main() {
3939
Flip::None,
4040
&TextureSettings::new()
4141
).unwrap());
42-
let mut sprite = Sprite::from_texture(tex.clone());
42+
let mut sprite = Sprite::from_texture(tex);
4343
sprite.set_position(width as f64 / 2.0, height as f64 / 2.0);
4444

4545
id = scene.add_child(sprite);
@@ -74,7 +74,7 @@ fn main() {
7474
clear([1.0, 1.0, 1.0, 1.0], g);
7575
scene.draw(c.transform, g);
7676
});
77-
if let Some(_) = e.press_args() {
77+
if e.press_args().is_some() {
7878
scene.toggle(id, &seq);
7979
scene.toggle(id, &rotate);
8080
}

examples/texture_swap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn main() {
3939
let mut counter = 0;
4040
window.set_bench_mode(true);
4141
while let Some(e) = window.next() {
42-
if let Some(_) = e.render_args() {
42+
if e.render_args().is_some() {
4343
counter += 1;
4444
if counter > frames { break; }
4545
}

0 commit comments

Comments
 (0)