Add functions for getting block properties as strings (#240) #2485
Annotations
18 warnings
|
this creates an owned instance just for comparison:
azalea-block/azalea-block-macros/src/lib.rs#L290
warning: this creates an owned instance just for comparison
--> azalea-block/azalea-block-macros/src/lib.rs:290:58
|
290 | if property_default_ident.to_string() != variant.ident.to_string() {
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: try: `variant.ident != property_default_ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
|
|
this creates an owned instance just for comparison:
azalea-block/azalea-block-macros/src/lib.rs#L290
warning: this creates an owned instance just for comparison
--> azalea-block/azalea-block-macros/src/lib.rs:290:20
|
290 | if property_default_ident.to_string() != variant.ident.to_string() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `property_default_ident`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
= note: `#[warn(clippy::cmp_owned)]` on by default
|
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
azalea-block/azalea-block-macros/src/property/generate.rs#L288
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> azalea-block/azalea-block-macros/src/property/generate.rs:288:9
|
288 | / match &property.data {
289 | | PropertyData::Enum { enum_name, .. } => {
290 | | let property_struct_name = enum_name.clone();
... |
297 | | _ => {}
298 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
288 ~ if let PropertyData::Enum { enum_name, .. } = &property.data {
289 + let property_struct_name = enum_name.clone();
290 +
291 + property_struct_names_to_names.insert(
292 + property_struct_name.to_string(),
293 + property.name.clone().value(),
294 + );
295 + }
|
|
|
the loop variable `index` is used to index `variants`:
azalea-block/azalea-block-macros/src/property/generate.rs#L242
warning: the loop variable `index` is used to index `variants`
--> azalea-block/azalea-block-macros/src/property/generate.rs:242:26
|
242 | for index in 0..variants.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()
|
242 - for index in 0..variants.len() {
242 + for (index, <item>) in variants.iter().enumerate() {
|
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
azalea-block/azalea-block-macros/src/property/generate.rs#L108
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> azalea-block/azalea-block-macros/src/property/generate.rs:108:48
|
108 | let value_tokens = match get_property_kind(&property_values) {
| ^^^^^^^^^^^^^^^^ help: change this to: `property_values`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
azalea-block/azalea-block-macros/src/property/generate.rs#L106
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> azalea-block/azalea-block-macros/src/property/generate.rs:106:62
|
106 | let try_from_block_state = generate_try_from_block_state(&property_values, last_state_id);
| ^^^^^^^^^^^^^^^^ help: change this to: `property_values`
|
= 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
|
|
the loop variable `i` is used to index `variants`:
azalea-block/azalea-block-macros/src/property/generate.rs#L45
warning: the loop variable `i` is used to index `variants`
--> azalea-block/azalea-block-macros/src/property/generate.rs:45:22
|
45 | for i in 0..variants.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()
|
45 - for i in 0..variants.len() {
45 + for (i, <item>) in variants.iter().enumerate() {
|
|
|
this creates an owned instance just for comparison:
azalea-block/azalea-block-macros/src/lib.rs#L290
warning: this creates an owned instance just for comparison
--> azalea-block/azalea-block-macros/src/lib.rs:290:58
|
290 | if property_default_ident.to_string() != variant.ident.to_string() {
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: try: `variant.ident != property_default_ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
|
|
this creates an owned instance just for comparison:
azalea-block/azalea-block-macros/src/lib.rs#L290
warning: this creates an owned instance just for comparison
--> azalea-block/azalea-block-macros/src/lib.rs:290:20
|
290 | if property_default_ident.to_string() != variant.ident.to_string() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `property_default_ident`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
= note: `#[warn(clippy::cmp_owned)]` on by default
|
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
azalea-block/azalea-block-macros/src/property/generate.rs#L288
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> azalea-block/azalea-block-macros/src/property/generate.rs:288:9
|
288 | / match &property.data {
289 | | PropertyData::Enum { enum_name, .. } => {
290 | | let property_struct_name = enum_name.clone();
... |
297 | | _ => {}
298 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
288 ~ if let PropertyData::Enum { enum_name, .. } = &property.data {
289 + let property_struct_name = enum_name.clone();
290 +
291 + property_struct_names_to_names.insert(
292 + property_struct_name.to_string(),
293 + property.name.clone().value(),
294 + );
295 + }
|
|
|
the loop variable `index` is used to index `variants`:
azalea-block/azalea-block-macros/src/property/generate.rs#L242
warning: the loop variable `index` is used to index `variants`
--> azalea-block/azalea-block-macros/src/property/generate.rs:242:26
|
242 | for index in 0..variants.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()
|
242 - for index in 0..variants.len() {
242 + for (index, <item>) in variants.iter().enumerate() {
|
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
azalea-block/azalea-block-macros/src/property/generate.rs#L108
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> azalea-block/azalea-block-macros/src/property/generate.rs:108:48
|
108 | let value_tokens = match get_property_kind(&property_values) {
| ^^^^^^^^^^^^^^^^ help: change this to: `property_values`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
azalea-block/azalea-block-macros/src/property/generate.rs#L106
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> azalea-block/azalea-block-macros/src/property/generate.rs:106:62
|
106 | let try_from_block_state = generate_try_from_block_state(&property_values, last_state_id);
| ^^^^^^^^^^^^^^^^ help: change this to: `property_values`
|
= 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
|
|
the loop variable `i` is used to index `variants`:
azalea-block/azalea-block-macros/src/property/generate.rs#L45
warning: the loop variable `i` is used to index `variants`
--> azalea-block/azalea-block-macros/src/property/generate.rs:45:22
|
45 | for i in 0..variants.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()
|
45 - for i in 0..variants.len() {
45 + for (i, <item>) in variants.iter().enumerate() {
|
|
|
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
|
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
|
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
|
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|