Skip to content

ci: ⚙️ Build and test on CI #5

ci: ⚙️ Build and test on CI

ci: ⚙️ Build and test on CI #5

GitHub Actions / Clippy Output succeeded Jan 28, 2024 in 0s

Clippy Output

47 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 47
Note 0
Help 0

Versions

  • rustc 1.75.0 (82e1608df 2023-12-21)
  • cargo 1.75.0 (1d8b05cdd 2023-11-20)
  • clippy 0.1.75 (82e1608 2023-12-21)

Annotations

Check warning on line 192 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
   --> src/main.rs:192:37
    |
192 |             Event::LoopDestroyed => return,
    |                                     ^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: replace `return` with a unit value
    |
192 |             Event::LoopDestroyed => (),
    |                                     ~~

Check warning on line 155 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

casting integer literal to `u16` is unnecessary

warning: casting integer literal to `u16` is unnecessary
   --> src/main.rs:155:54
    |
155 |                 let x = 1.0f32 * f32::from(counter % 7 as u16);
    |                                                      ^^^^^^^^ help: try: `7_u16`
    |
    = 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

Check warning on line 155 in src/support/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
   --> src/support/mod.rs:155:5
    |
155 |     return dir;
    |     ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
    |
155 -     return dir;
155 +     dir
    |

Check warning on line 149 in src/support/texture.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

this operation has no effect

warning: this operation has no effect
   --> src/support/texture.rs:149:41
    |
149 |                     data.push(self.data[(i * self.unit_bytes + 0) as usize]); // R
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `i * self.unit_bytes`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check warning on line 141 in src/support/texture.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

this operation has no effect

warning: this operation has no effect
   --> src/support/texture.rs:141:41
    |
141 |                     data.push(self.data[(i * self.unit_bytes + 0) as usize]); // R
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `i * self.unit_bytes`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check warning on line 93 in src/support/texture.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

this operation has no effect

warning: this operation has no effect
  --> src/support/texture.rs:93:26
   |
93 |                         [(self.data[i as usize] as u32 * palette.unit_bytes + 0) as usize],
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `self.data[i as usize] as u32 * palette.unit_bytes`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check warning on line 266 in src/support/resource.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

this operation has no effect

warning: this operation has no effect
   --> src/support/resource.rs:266:32
    |
266 |                         params[row * 3 + 0],
    |                                ^^^^^^^^^^^ help: consider reducing it to: `row * 3`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check warning on line 260 in src/support/resource.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the loop variable `i` is only used to index `params`

warning: the loop variable `i` is only used to index `params`
   --> src/support/resource.rs:260:26
    |
260 |                 for i in 0..12 {
    |                          ^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
260 |                 for <item> in &mut params {
    |                     ~~~~~~    ~~~~~~~~~~~

Check warning on line 147 in src/support/resource.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the loop variable `i` is only used to index `params`

warning: the loop variable `i` is only used to index `params`
   --> src/support/resource.rs:147:26
    |
147 |                 for i in 0..12 {
    |                          ^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
147 |                 for <item> in &mut params {
    |                     ~~~~~~    ~~~~~~~~~~~

Check warning on line 32 in src/support/resource.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default()
  --> src/support/resource.rs:32:9
   |
32 |         h.chunk_type = source.read_u32::<BigEndian>()?;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: consider initializing the variable with `support::resource::ChunkHeader { chunk_type: source.read_u32::<BigEndian>()?, size: source.read_u32::<BigEndian>()? }` and removing relevant reassignments
  --> src/support/resource.rs:31:9
   |
31 |         let mut h = ChunkHeader::default();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 256 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

using `clone` on type `Matrix4<f32>` which implements the `Copy` trait

warning: using `clone` on type `Matrix4<f32>` which implements the `Copy` trait
   --> src/support/render_manager.rs:256:36
    |
256 |         let model: [[f32; 4]; 4] = model.clone().into();
    |                                    ^^^^^^^^^^^^^ help: try dereferencing it: `(*model)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `#[warn(clippy::clone_on_copy)]` on by default

Check warning on line 206 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

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/support/render_manager.rs:206:47
    |
206 |                         self.draw_actor(name, &transform_stack.last().unwrap(), target, camera);
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `transform_stack.last().unwrap()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 202 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

dereferencing a tuple pattern where every element takes a reference

warning: dereferencing a tuple pattern where every element takes a reference
   --> src/support/render_manager.rs:202:17
    |
202 |                 &ActorNode::MeshfileRef(ref name) => {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference
help: try removing the `&` and `ref` parts
    |
202 -                 &ActorNode::MeshfileRef(ref name) => {
202 +                 ActorNode::MeshfileRef(name) => {
    |

Check warning on line 226 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

you don't need to add `&` to all patterns

warning: you don't need to add `&` to all patterns
   --> src/support/render_manager.rs:185:13
    |
185 | /             match actor.data() {
186 | |                 &ActorNode::Actor { ref name, visible } => {
187 | |                     actor_name = name.clone();
188 | |                     v = visible;
...   |
225 | |                 _ => (),
226 | |             }
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats
    = note: `#[warn(clippy::match_ref_pats)]` on by default
help: instead of prefixing all patterns with `&`, you can dereference the expression
    |
185 ~             match *actor.data() {
186 ~                 ActorNode::Actor { ref name, visible } => {
187 |                     actor_name = name.clone();
  ...
201 |                 }
202 ~                 ActorNode::MeshfileRef(ref name) => {
203 |                     debug_tree(&format!("Mesh {}", name), &actor_name, &transform_stack);
  ...
208 |                 }
209 ~                 ActorNode::Transform(t) => {
    |

Check warning on line 162 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

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/support/render_manager.rs:162:81
    |
162 |                         IndexBuffer::new(display, PrimitiveType::TrianglesList, &item).unwrap(),
    |                                                                                 ^^^^^ help: change this to: `item`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 140 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

use of `or_insert` to construct default value

warning: use of `or_insert` to construct default value
   --> src/support/render_manager.rs:140:18
    |
140 |                 .or_insert(Vec::new());
    |                  ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

Check warning on line 117 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

dereferencing a tuple pattern where every element takes a reference

warning: dereferencing a tuple pattern where every element takes a reference
   --> src/support/render_manager.rs:117:17
    |
117 |                 &ActorNode::MeshfileRef(ref name) => {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference
help: try removing the `&` and `ref` parts
    |
117 -                 &ActorNode::MeshfileRef(ref name) => {
117 +                 ActorNode::MeshfileRef(name) => {
    |

Check warning on line 122 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> src/support/render_manager.rs:116:13
    |
116 | /             match actor.data() {
117 | |                 &ActorNode::MeshfileRef(ref name) => {
118 | |                     debug!("Actor meshfile {}", name);
119 | |                     self.prepare_car_actor(name, car, display);
120 | |                 }
121 | |                 _ => (),
122 | |             }
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
help: try
    |
116 ~             if let &ActorNode::MeshfileRef(ref name) = actor.data() {
117 +                 debug!("Actor meshfile {}", name);
118 +                 self.prepare_car_actor(name, car, display);
119 +             }
    |

Check warning on line 85 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

use of `or_insert` to construct default value

warning: use of `or_insert` to construct default value
  --> src/support/render_manager.rs:85:18
   |
85 |                 .or_insert(HashMap::new());
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
   = note: `#[warn(clippy::unwrap_or_default)]` on by default

Check warning on line 81 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

you seem to want to iterate on a map's keys

warning: you seem to want to iterate on a map's keys
  --> src/support/render_manager.rs:81:26
   |
81 |         for (&mat, _) in &self.indices[actor_name] {
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map
help: use the corresponding method
   |
81 |         for &mat in self.indices[actor_name].keys() {
   |             ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 58 in src/support/render_manager.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

you seem to want to iterate on a map's keys

warning: you seem to want to iterate on a map's keys
  --> src/support/render_manager.rs:58:33
   |
58 |         for (name, _indices) in &self.indices {
   |                                 ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map
   = note: `#[warn(clippy::for_kv_map)]` on by default
help: use the corresponding method
   |
58 |         for name in self.indices.keys() {
   |             ~~~~    ~~~~~~~~~~~~~~~~~~~

Check warning on line 110 in src/support/mesh.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the loop variable `n` is used to index `uvcoords`

warning: the loop variable `n` is used to index `uvcoords`
   --> src/support/mesh.rs:110:18
    |
110 |         for n in 0..uvcoords.len() {
    |                  ^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator and enumerate()
    |
110 |         for (n, <item>) in uvcoords.iter().enumerate() {
    |             ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 105 in src/support/mesh.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the loop variable `i` is used to index `fmlist`

warning: the loop variable `i` is used to index `fmlist`
   --> src/support/mesh.rs:105:22
    |
105 |             for i in 0..m.faces.len() {
    |                      ^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
    = note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
    |
105 |             for (i, <item>) in fmlist.iter().enumerate().take(m.faces.len()) {
    |                 ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 104 in src/support/mesh.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

length comparison to zero

warning: length comparison to zero
   --> src/support/mesh.rs:104:12
    |
104 |         if fmlist.len() > 0 && m.faces.len() == fmlist.len() {
    |            ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!fmlist.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
    = note: `#[warn(clippy::len_zero)]` on by default

Check warning on line 47 in src/support/mesh.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default()
  --> src/support/mesh.rs:47:9
   |
47 |         s.v1 = rdr.read_u16::<BigEndian>()?;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: consider initializing the variable with `support::mesh::Face { v1: rdr.read_u16::<BigEndian>()?, v2: rdr.read_u16::<BigEndian>()?, v3: rdr.read_u16::<BigEndian>()?, flags: rdr.read_u16::<BigEndian>()?, ..Default::default() }` and removing relevant reassignments
  --> src/support/mesh.rs:46:9
   |
46 |         let mut s = Face::default();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default