Skip to content

API nits

API nits #450

Triggered via pull request October 5, 2024 20:26
@leodleod
opened #180
api_nits
Status Success
Total duration 1m 12s
Artifacts

rust.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

15 warnings
initializer for `thread_local` value can be made `const`: src/sl.rs#L107
warning: initializer for `thread_local` value can be made `const` --> src/sl.rs:107:65 | 107 | static MAP: RefCell<BTreeMap<TypeId, Rc<StructType>>> = RefCell::new(BTreeMap::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(BTreeMap::new()) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_thread_local = note: `#[warn(clippy::missing_const_for_thread_local)]` on by default
docs for unsafe trait missing `# Safety` section: src/sl/sig.rs#L8
warning: docs for unsafe trait missing `# Safety` section --> src/sl/sig.rs:8:1 | 8 | pub unsafe trait Const {} | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
docs for unsafe trait missing `# Safety` section: src/sl/interpolant.rs#L13
warning: docs for unsafe trait missing `# Safety` section --> src/sl/interpolant.rs:13:1 | 13 | pub unsafe trait Interpolant: Value { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc = note: `#[warn(clippy::missing_safety_doc)]` on by default
match expression looks like `matches!` macro: src/gl/raw/image.rs#L222
warning: match expression looks like `matches!` macro --> src/gl/raw/image.rs:222:9 | 222 | / match self { 223 | | DepthU24StencilU8 => true, 224 | | _ => false, 225 | | } | |_________^ help: try: `matches!(self, DepthU24StencilU8)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
match expression looks like `matches!` macro: src/gl/raw/image.rs#L209
warning: match expression looks like `matches!` macro --> src/gl/raw/image.rs:209:9 | 209 | / match self { 210 | | DepthU16 => true, 211 | | DepthF32 => true, 212 | | DepthU24StencilU8 => true, 213 | | _ => false, 214 | | } | |_________^ help: try: `matches!(self, DepthU16 | DepthF32 | DepthU24StencilU8)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
the loop variable `i` is used to index `self`: src/interface/uniform_interface.rs#L204
warning: the loop variable `i` is used to index `self` --> src/interface/uniform_interface.rs:204:18 | 204 | for i in 0..N { | ^^^^ | = 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() | 204 | for (i, <item>) in self.iter().enumerate().take(N) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function `call_func_def` is never used: src/sl/primitives.rs#L192
warning: function `call_func_def` is never used --> src/sl/primitives.rs:192:8 | 192 | pub fn call_func_def<R: Value>(def: FuncDef, args: Vec<Rc<Expr>>) -> R { | ^^^^^^^^^^^^^
function `built_in_4` is never used: src/sl/primitives.rs#L154
warning: function `built_in_4` is never used --> src/sl/primitives.rs:154:15 | 154 | pub(crate) fn built_in_4<U, V, W, X, R>( | ^^^^^^^^^^
method `is_empty` is never used: src/gl/raw/buffer.rs#L81
warning: method `is_empty` is never used --> src/gl/raw/buffer.rs:81:12 | 40 | impl Buffer { | ----------- method in this implementation ... 81 | pub fn is_empty(&self) -> bool { | ^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unneeded unit expression: src/sl/interpolant.rs#L86
warning: unneeded unit expression --> src/sl/interpolant.rs:86:17 | 86 | / ( 87 | | $($name::shader_input(&join_ident_path(path, stringify!($name))),)* 88 | | ) | |_________________^ help: remove the final `()` ... 94 | smaller_tuples_too!(tuple_impl, T0, T1, T2, T3, T4, T5, T6, T7); | --------------------------------------------------------------- in this macro invocation | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit = note: `#[warn(clippy::unused_unit)]` on by default = note: this warning originates in the macro `tuple_impl` which comes from the expansion of the macro `smaller_tuples_too` (in Nightly builds, run with -Z macro-backtrace for more info)
useless use of `vec!`: derive/src/utils.rs#L117
warning: useless use of `vec!` --> derive/src/utils.rs:117:24 | 117 | let fragment_tys = vec!["ColorAttachment"]; | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["ColorAttachment"]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
useless use of `vec!`: derive/src/utils.rs#L115
warning: useless use of `vec!` --> derive/src/utils.rs:115:22 | 115 | let vertex_tys = vec!["Block"]; | ^^^^^^^^^^^^^ help: you can use an array directly: `["Block"]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec = note: `#[warn(clippy::useless_vec)]` on by default
method `attrs` is never used: derive/src/utils.rs#L56
warning: method `attrs` is never used --> derive/src/utils.rs:56:12 | 16 | impl StructFields { | ----------------- method in this implementation ... 56 | pub fn attrs(&self) -> Vec<&[Attribute]> { | ^^^^^ | = note: `#[warn(dead_code)]` on by default
build
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
build
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/