Update README.md #10
clippy
9 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 9 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.0-nightly (6b4f1c5e7 2024-01-27)
- cargo 1.77.0-nightly (7bb7b5395 2024-01-20)
- clippy 0.1.77 (6b4f1c5 2024-01-27)
Annotations
Check warning on line 82 in src/main.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/main.rs:82:37
|
82 | draw_mesh(&mut context, &mesh, rot, default_shader); // Draw all meshes
| ^^^^^ help: change this to: `mesh`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 42 in src/main.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/main.rs:42:44
|
42 | match_dimensions(&mut context, &matches)?;
| ^^^^^^^^ help: change this to: `matches`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 115 in src/inputs.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/inputs.rs:115:71
|
115 | "stl" => match OpenOptions::new().read(true).open(&path) {
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Check warning on line 108 in src/inputs.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/inputs.rs:108:51
|
108 | "obj" => match tobj::load_obj(&path, &tobj::GPU_LOAD_OPTIONS) {
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
Check warning on line 44 in src/rasterizer.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/rasterizer.rs:44:32
|
44 | draw_triangle(context, &triangle, transform, &shader);
| ^^^^^^^^^ help: change this to: `triangle`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
Check warning on line 44 in src/context.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/context.rs:44:53
|
44 | ... self.z_buffer = vec![f32::MAX; self.width * self.height as usize]; //f32::MAX is written to the z-buffer as an infinite back-wall t...
| ^^^^^^^^^^^^^^^^^^^^ help: try: `self.height`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 42 in src/context.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/context.rs:38:13
|
38 | / if self.image {
39 | | self.width * self.height + self.height
40 | | } else {
41 | | self.width * self.height
42 | | } as usize
| |______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
help: try
|
38 ~ if self.image {
39 + self.width * self.height + self.height
40 + } else {
41 + self.width * self.height
42 + }
|
Check warning on line 74 in src/main.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> src/main.rs:62:9
|
62 | / if !context.image {
63 | | if poll(target_frame_time - last_time.elapsed())? {
64 | | if let Event::Key(KeyEvent { code, modifiers }) = read()? {
65 | | if code == KeyCode::Char('q')
... |
73 | | }
74 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
62 ~ if !context.image && poll(target_frame_time - last_time.elapsed())? {
63 + if let Event::Key(KeyEvent { code, modifiers }) = read()? {
64 + if code == KeyCode::Char('q')
65 + || (code == KeyCode::Char('c') && (modifiers == KeyModifiers::CONTROL))
66 + {
67 + stdout.execute(cursor::Show)?;
68 + crossterm::terminal::disable_raw_mode()?;
69 + break;
70 + }
71 + }
72 + }
|
Check warning on line 7 in src/inputs.rs
github-actions / clippy
unused import: `tobj::LoadOptions`
warning: unused import: `tobj::LoadOptions`
--> src/inputs.rs:7:5
|
7 | use tobj::LoadOptions;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default