Fix install bottlenecks from logging (#659) #11
lint.yaml
on: push
Frontend
35s
Backend Formatting
28s
Backend Linter
3m 43s
Annotations
84 warnings
Backend Formatting
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Backend Formatting
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/
|
Backend Formatting
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/
|
Backend Formatting
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/
|
Backend Formatting
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/
|
Frontend
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
useless use of `format!`:
src/main.rs#L45
warning: useless use of `format!`
--> src/main.rs:45:25
|
45 | let mut dialog_text = format!("Unrecoverable crash occurred!");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unrecoverable crash occurred!".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
|
current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.64.0`:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/macros/select.rs#L515
warning: current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.64.0`
--> src/util/process.rs:66:5
|
66 | / tokio::select! {
67 | | Ok(Some(line)) = stdout_reader.next_line() => {
68 | | let formatted_line = format!("{line}\n").trim().to_string();
69 | | if formatted_line != "\n" {
... |
87 | | }
88 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
= note: this warning originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)
|
current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.64.0`:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/macros/select.rs#L505
warning: current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.64.0`
--> src/util/process.rs:66:5
|
66 | / tokio::select! {
67 | | Ok(Some(line)) = stdout_reader.next_line() => {
68 | | let formatted_line = format!("{line}\n").trim().to_string();
69 | | if formatted_line != "\n" {
... |
87 | | }
88 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
= note: `#[warn(clippy::incompatible_msrv)]` on by default
= note: this warning originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)
|
unneeded `return` statement:
src/util/os.rs#L17
warning: unneeded `return` statement
--> src/util/os.rs:17:3
|
17 | return None;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
17 - return None;
17 + None
|
|
unneeded `return` statement:
src/util/game_tests.rs#L171
warning: unneeded `return` statement
--> src/util/game_tests.rs:171:7
|
171 | / return Err(CommandError::BinaryExecution(
172 | | "GPU test failed, no exit-code returned".to_owned(),
173 | | ))
| |________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
171 ~ Err(CommandError::BinaryExecution(
172 + "GPU test failed, no exit-code returned".to_owned(),
173 + ))
|
|
unneeded `return` statement:
src/util/game_tests.rs#L165
warning: unneeded `return` statement
--> src/util/game_tests.rs:165:9
|
165 | / return Err(CommandError::BinaryExecution(
166 | | "GPU Test failed with a non-zero exit code".to_owned(),
167 | | ));
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
165 ~ Err(CommandError::BinaryExecution(
166 + "GPU Test failed with a non-zero exit code".to_owned(),
167 ~ ))
|
|
unneeded `return` statement:
src/util/game_tests.rs#L159
warning: unneeded `return` statement
--> src/util/game_tests.rs:159:13
|
159 | / return Err(CommandError::BinaryExecution(
160 | | "Unable to parse GPU test result".to_owned(),
161 | | ));
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
159 ~ Err(CommandError::BinaryExecution(
160 + "Unable to parse GPU test result".to_owned(),
161 ~ ))
|
|
unneeded `return` statement:
src/util/game_tests.rs#L155
warning: unneeded `return` statement
--> src/util/game_tests.rs:155:13
|
155 | return Ok(test_results);
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
155 - return Ok(test_results);
155 + Ok(test_results)
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/util/game_tests.rs#L40
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/util/game_tests.rs:40:83
|
40 | let tooling_version = Version::parse(active_version.strip_prefix('v').unwrap_or(&active_version))
| ^^^^^^^^^^^^^^^ help: change this to: `active_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded `return` statement:
src/util/game_milestones.rs#L19
warning: unneeded `return` statement
--> src/util/game_milestones.rs:19:3
|
19 | / return vec![
20 | | MilestoneCriteria {
21 | | name: "geyser".to_string(),
22 | | completed: vec![],
... |
227 | | },
228 | | ];
| |___^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
19 ~ vec![
20 + MilestoneCriteria {
21 + name: "geyser".to_string(),
22 + completed: vec![],
23 + introduced: vec![],
24 + },
25 + MilestoneCriteria {
26 + // (village1-yakow 10)
27 + // (village1-mayor-money 11)
28 + // (village1-uncle-money 12)
29 + // (village1-oracle-money1 13)
30 + // (village1-oracle-money2 14)
31 + // (beach-ecorocks 15)
32 + // (village1-buzzer 75)
33 + name: "sandover".to_string(),
34 + completed: vec![10, 11, 12, 13, 14, 75],
35 + introduced: vec![15],
36 + },
37 + MilestoneCriteria {
38 + // (beach-ecorocks 15)
39 + // (beach-pelican 16)
40 + // (beach-flutflut 17)
41 + // (beach-seagull 18)
42 + // (beach-cannon 19)
43 + // (beach-buzzer 20)
44 + // (beach-gimmie 21)
45 + // (beach-sentinel 22)
46 + name: "sentinel".to_string(),
47 + completed: vec![15, 16, 17, 18, 19, 20, 21, 22],
48 + introduced: vec![],
49 + },
50 + MilestoneCriteria {
51 + // (jungle-eggtop 2)
52 + // (jungle-lurkerm 3)
53 + // (jungle-tower 4)
54 + // (jungle-fishgame 5)
55 + // (jungle-plant 6)
56 + // (jungle-buzzer 7)
57 + // (jungle-canyon-end 8)
58 + // (jungle-temple-door 9)
59 + name: "jungle".to_string(),
60 + completed: vec![2, 3, 4, 5, 6, 7, 8, 9],
61 + introduced: vec![],
62 + },
63 + MilestoneCriteria {
64 + // (misty-muse 23)
65 + // (misty-boat 24)
66 + // (misty-warehouse 25)
67 + // (misty-cannon 26)
68 + // (misty-bike 27)
69 + // (misty-buzzer 28)
70 + // (misty-bike-jump 29)
71 + // (misty-eco-challenge 30)
72 + // (leaving-misty 114)
73 + name: "misty".to_string(),
74 + completed: vec![23, 24, 25, 26, 27, 28, 29, 30, 114],
75 + introduced: vec![],
76 + },
77 + MilestoneCriteria {
78 + // (firecanyon-buzzer 68)
79 + // (firecanyon-end 69)
80 + // (firecanyon-assistant 102)
81 + name: "firecanyon".to_string(),
82 + completed: vec![68, 69],
83 + introduced: vec![102],
84 + },
85 + MilestoneCriteria {
86 + // (village2-gambler-money 31)
87 + // (village2-geologist-money 32)
88 + // (village2-warrior-money 33)
89 + // (village2-oracle-money1 34)
90 + // (village2-oracle-money2 35)
91 + // (firecanyon-buzzer 68)
92 + // (firecanyon-end 69)
93 + // (village2-buzzer 76)
94 + // (firecanyon-assistant 102)
95 + name: "village2".to_string(),
96 + completed: vec![31, 32, 33, 34, 35, 68, 69],
97 + introduced: vec![76, 102],
98 + },
99 + MilestoneCriteria {
100 + // (rolling-race 52)
101 + // (rolling-robbers 53)
102 + // (rolling-moles 54)
103 + // (rolling-plants 55)
104 + // (rolling-lake 56)
105 + // (rolling-buzzer 57)
106 + // (rolling-ring-chase-1 58)
107 + // (rolling-ring-chase-2 59)
108 + name: "basin".to_string(),
109 + completed: vec![52, 53, 54, 55, 56, 57, 58, 59],
110 + introduced: vec![],
111 + },
112 + MilestoneCriteria {
113 + // (swamp-billy 36)
114 + // (swamp-flutflut 37)
115 + // (swamp-battle 38)
116 + // (swamp-tether-1 39)
117 + // (swamp-tether-2 40)
118 + // (swamp-tether-3 41)
119 + // (swamp-tether-4 42)
120 + // (swamp-buzzer 43)
121 + // (swamp-arm 104)
122 + name: "swamp".to_string(),
123 + completed: vec![36, 37, 38, 39, 40, 41, 42, 43, 104],
124 + introduced: vec![],
125 + },
126 + MilestoneCriteria {
127 + // (sunken-platforms 44)
128 + // (sunken-pipe 45)
129 + // (sunken-slide 46)
130 + // (sunken-room 47)
131 + // (sunken-sharks 48)
132 + // (sunken-buzzer 49)
133 + // (sunken-top-of-helix 50)
134 + // (sunken-spinning-room 51)
135 + name: "lpc".to_string(),
136 + completed: vec![44, 45, 46, 47, 48, 49, 50, 51],
137 + introduced: vec![],
138 + },
139 + MilestoneCriteria {
140 + // (ogre-boss 86)
141 + // (village2-levitator 103)
142 + name: "klaww".to_string(),
143 + completed: vec![103],
144 + introduced: vec![86],
145 + },
146 + MilestoneCriteria {
147 + // (ogre-boss 86)
148 + // (ogre-end 87)
149 + // (ogre-buzzer 88)
150 + // (ogre-secret 110)
151 + name: "mountainpass".to_string(),
152 + completed: vec![86, 88, 110],
153 + introduced: vec![87],
154 + },
155 + MilestoneCriteria {
156 + // (village3-extra1 74)
157 + // (village3-buzzer 77)
158 + // (village3-miner-money1 96)
159 + // (village3-miner-money2 97)
160 + // (village3-miner-money3 98)
161 + // (village3-miner-money4 99)
162 + // (village3-oracle-money1 100)
163 + // (village3-oracle-money2 101)
164 + // (village3-button 105)
165 + name: "village3".to_string(),
166 + completed: vec![74, 77, 96, 97, 98, 99, 100, 101, 105],
167 + introduced: vec![],
168 + },
169 + MilestoneCriteria {
170 + // (cave-gnawers 78)
171 + // (cave-dark-crystals 79)
172 + // (cave-dark-climb 80)
173 + // (cave-robot-climb 81)
174 + // (cave-swing-poles 82)
175 + // (cave-spider-tunnel 83)
176 + // (cave-platforms 84)
177 + // (cave-buzzer 85)
178 + name: "cave".to_string(),
179 + completed: vec![78, 79, 80, 81, 82, 83, 84, 85],
180 + introduced: vec![],
181 + },
182 + MilestoneCriteria {
183 + // (snow-eggtop 60)
184 + // (snow-ram 61)
185 + // (snow-fort 62)
186 + // (snow-ball 63)
187 + // (snow-bunnies 64)
188 + // (snow-buzzer 65)
189 + // (snow-bumpers 66)
190 + // (snow-cage 67)
191 + name: "snowy".to_string(),
192 + completed: vec![60, 61, 62, 63, 64, 65, 66, 67],
193 + introduced: vec![],
194 + },
195 + MilestoneCriteria {
196 + // (lavatube-end 89)
197 + // (lavatube-buzzer 90)
198 + // (lavatube-balls 107)
199 + // (lavatube-start 108)
200 + // (assistant-village3 115)
201 + name: "lavatube".to_string(),
202 + completed: vec![90, 107, 108, 115],
203 + introduced: vec![89],
204 + },
205 + MilestoneCriteria {
206 + // (citadel-sage-green 70)
207 + // (citadel-sage-blue 71)
208 + // (citadel-sage-red 72)
209 + // (citadel-sage-yellow 73)
210 + // (lavatube-end 89)
211 + // (citadel-buzzer 91)
212 + name: "citadel".to_string(),
213 + completed: vec![71, 72, 73, 89, 91],
214 + introduced: vec![70],
215 + },
216 + MilestoneCriteria {
217 + // (citadel-sage-green 70)
218 + name: "finalboss".to_string(),
219 + completed: vec![70],
220 + introduced: vec![],
221 + },
222 + MilestoneCriteria {
223 + // (finalboss-movies 112)
224 + name: "end".to_string(),
225 + completed: vec![],
226 + introduced: vec![112],
227 + },
228 ~ ]
|
|
unneeded `return` statement:
src/util/file.rs#L78
warning: unneeded `return` statement
--> src/util/file.rs:78:3
|
78 | / return format!(
79 | | "data:image/{};base64,{}",
80 | | get_image_file_type(&hex),
81 | | base64.replace("\r\n", "")
82 | | );
| |___^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
78 ~ format!(
79 + "data:image/{};base64,{}",
80 + get_image_file_type(&hex),
81 + base64.replace("\r\n", "")
82 ~ )
|
|
file opened with `create`, but `truncate` behavior not defined:
src/util/file.rs#L52
warning: file opened with `create`, but `truncate` behavior not defined
--> src/util/file.rs:52:6
|
52 | .create(true)
| ^^^^^^^^^^^^- help: add: `.truncate(true)`
|
= help: if you intend to overwrite an existing file entirely, call `.truncate(true)`
= help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)`
= help: alternatively, use `.append(true)` to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
= note: `#[warn(clippy::suspicious_open_options)]` on by default
|
use of `unwrap_or` to construct default value:
src/config.rs#L579
warning: use of `unwrap_or` to construct default value
--> src/config.rs:579:39
|
579 | let texture_packs = texture_packs.unwrap_or(Vec::new());
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_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
|
unneeded `return` statement:
src/config.rs#L520
warning: unneeded `return` statement
--> src/config.rs:520:11
|
520 | return Err(ConfigError::Configuration("Invalid key".to_owned()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
520 - return Err(ConfigError::Configuration("Invalid key".to_owned()));
520 + Err(ConfigError::Configuration("Invalid key".to_owned()))
|
|
unneeded `return` statement:
src/config.rs#L517
warning: unneeded `return` statement
--> src/config.rs:517:29
|
517 | "installed_mods" => return Ok(json!(game_config.mods_installed_version)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
517 | "installed_mods" => Ok(json!(game_config.mods_installed_version)),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/config.rs#L516
warning: unneeded `return` statement
--> src/config.rs:516:29
|
516 | "seconds_played" => return Ok(json!(game_config.seconds_played)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
516 | "seconds_played" => Ok(json!(game_config.seconds_played)),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/config.rs#L515
warning: unneeded `return` statement
--> src/config.rs:515:35
|
515 | "active_texture_packs" => return Ok(json!(game_config.active_texture_packs())),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
515 | "active_texture_packs" => Ok(json!(game_config.active_texture_packs())),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/config.rs#L514
warning: unneeded `return` statement
--> src/config.rs:514:32
|
514 | "installed_version" => return Ok(json!(game_config.version())),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
514 | "installed_version" => Ok(json!(game_config.version())),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/config.rs#L513
warning: unneeded `return` statement
--> src/config.rs:513:24
|
513 | "installed" => return Ok(Value::Bool(game_config.is_installed)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
513 | "installed" => Ok(Value::Bool(game_config.is_installed)),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/config.rs#L193
warning: unneeded `return` statement
--> src/config.rs:193:3
|
193 | return "2.0".to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
193 - return "2.0".to_owned();
193 + "2.0".to_owned()
|
|
unneeded `return` statement:
src/commands/util.rs#L132
warning: unneeded `return` statement
--> src/commands/util.rs:132:3
|
132 | return Ok(false);
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
132 - return Ok(false);
132 + Ok(false)
|
|
unneeded `return` statement:
src/commands/util.rs#L120
warning: unneeded `return` statement
--> src/commands/util.rs:120:3
|
120 | return is_x86_feature_detected!("avx") || is_x86_feature_detected!("avx2");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
120 - return is_x86_feature_detected!("avx") || is_x86_feature_detected!("avx2");
120 + is_x86_feature_detected!("avx") || is_x86_feature_detected!("avx2")
|
|
unneeded `return` statement:
src/commands/util.rs#L109
warning: unneeded `return` statement
--> src/commands/util.rs:109:3
|
109 | return Ok(false);
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
109 - return Ok(false);
109 + Ok(false)
|
|
unneeded `return` statement:
src/commands/util.rs#L85
warning: unneeded `return` statement
--> src/commands/util.rs:85:3
|
85 | / return Err(CommandError::Configuration(
86 | | "Unable to find relevant drive to check for space".to_owned(),
87 | | ));
| |____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
85 ~ Err(CommandError::Configuration(
86 + "Unable to find relevant drive to check for space".to_owned(),
87 ~ ))
|
|
the borrowed expression implements the required traits:
src/commands/util.rs#L29
warning: the borrowed expression implements the required traits
--> src/commands/util.rs:29:32
|
29 | Some(dir) => Ok(delete_dir(&dir.join("data"))?),
| ^^^^^^^^^^^^^^^^^ help: change this to: `dir.join("data")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L470
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:470:14
|
470 | fs::rename(&save_file.path(), save_path).map_err(|_| {
| ^^^^^^^^^^^^^^^^^ help: change this to: `save_file.path()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/commands/support.rs#L231
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/support.rs:231:19
|
231 | &mod_path,
| ^^^^^^^^^ help: change this to: `mod_path`
|
= 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:
src/commands/support.rs#L219
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/support.rs:219:19
|
219 | &mod_path,
| ^^^^^^^^^ help: change this to: `mod_path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
src/commands/support.rs#L196
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:196:58
|
196 | let mod_directory = install_path.join("features").join(&game_name).join("mods");
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L165
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:165:44
|
165 | let data_dir = active_version_dir.join(&game_name).join("data");
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L153
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:153:11
|
153 | .join(&game_name)
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L150
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:150:11
|
150 | .join(&game_name)
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L144
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:144:11
|
144 | .join(&game_name)
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L134
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:134:46
|
134 | let jak1_log_dir = active_version_dir.join(&game_name).join("data").join("log");
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L124
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:124:27
|
124 | &game_config_dir.join(&game_name).join("saves"),
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L115
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:115:27
|
115 | &game_config_dir.join(&game_name).join("misc"),
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/support.rs#L106
warning: the borrowed expression implements the required traits
--> src/commands/support.rs:106:27
|
106 | &game_config_dir.join(&game_name).join("settings"),
| ^^^^^^^^^^ help: change this to: `game_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
src/commands/game.rs#L221
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/commands/game.rs:221:9
|
221 | / match get_saves_highest_milestone(&entry.into_path(), &milestones) {
222 | | Some((name, idx)) => {
223 | | info!("Furthest milestone {} at index {}", name, idx);
224 | | if idx > highest_milestone_idx {
... |
229 | | None => {}
230 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
help: try
|
221 ~ if let Some((name, idx)) = get_saves_highest_milestone(&entry.into_path(), &milestones) {
222 + info!("Furthest milestone {} at index {}", name, idx);
223 + if idx > highest_milestone_idx {
224 + highest_milestone_idx = idx;
225 + furthest_milestone_name = name.to_owned();
226 + }
227 + }
|
|
unneeded `return` statement:
src/commands/game.rs#L235
warning: unneeded `return` statement
--> src/commands/game.rs:235:3
|
235 | return Ok(furthest_milestone_name);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
235 - return Ok(furthest_milestone_name);
235 + Ok(furthest_milestone_name)
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/commands/game.rs#L157
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/game.rs:157:48
|
157 | if tasks.contains_key(&task_id) && tasks[&task_id].completed {
| ^^^^^^^^ help: change this to: `task_id`
|
= 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:
src/commands/game.rs#L157
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/game.rs:157:29
|
157 | if tasks.contains_key(&task_id) && tasks[&task_id].completed {
| ^^^^^^^^ help: change this to: `task_id`
|
= 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:
src/commands/game.rs#L152
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/game.rs:152:48
|
152 | if tasks.contains_key(&task_id) && tasks[&task_id].introduced {
| ^^^^^^^^ help: change this to: `task_id`
|
= 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:
src/commands/game.rs#L152
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/game.rs:152:29
|
152 | if tasks.contains_key(&task_id) && tasks[&task_id].introduced {
| ^^^^^^^^ help: change this to: `task_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/commands/game.rs#L111
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/commands/game.rs:111:15
|
111 | milestones: &Vec<MilestoneCriteria>,
| ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[MilestoneCriteria]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
unneeded `return` statement:
src/commands/game.rs#L163
warning: unneeded `return` statement
--> src/commands/game.rs:163:3
|
163 | return None;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
163 - return None;
163 + None
|
|
the borrowed expression implements the required traits:
src/commands/features/texture_packs.rs#L322
warning: the borrowed expression implements the required traits
--> src/commands/features/texture_packs.rs:322:22
|
322 | match delete_dir(&texture_pack_dir.join(&pack)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `texture_pack_dir.join(&pack)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/commands/features/texture_packs.rs#L271
warning: the borrowed expression implements the required traits
--> src/commands/features/texture_packs.rs:271:15
|
271 | .join(&pack)
| ^^^^^ help: change this to: `pack`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/commands/features/texture_packs.rs#L221
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/texture_packs.rs:221:35
|
221 | extract_zip_file(&zip_path_buf, &destination_dir, false).map_err(|err| {
| ^^^^^^^^^^^^^^^^ help: change this to: `destination_dir`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
you seem to be trying to use `match` for an equality check. Consider using `if`:
src/commands/features/texture_packs.rs#L128
warning: you seem to be trying to use `match` for an equality check. Consider using `if`
--> src/commands/features/texture_packs.rs:128:7
|
128 | / match entry_path.join("metadata.json").exists() {
129 | | true => {
130 | | match std::fs::read_to_string(entry_path.join("metadata.json")) {
131 | | Ok(content) => {
... |
156 | | false => {}
157 | | }
| |_______^
|
= 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
|
128 ~ if entry_path.join("metadata.json").exists() == true {
129 + match std::fs::read_to_string(entry_path.join("metadata.json")) {
130 + Ok(content) => {
131 + // Serialize from json
132 + match serde_json::from_str::<TexturePackInfo>(&content) {
133 + Ok(pack_metadata) => {
134 + pack_info.name = pack_metadata.name;
135 + pack_info.version = pack_metadata.version;
136 + pack_info.author = pack_metadata.author;
137 + pack_info.release_date = pack_metadata.release_date;
138 + pack_info.description = pack_metadata.description;
139 + pack_info.tags = pack_metadata.tags;
140 + }
141 + Err(err) => {
142 + log::error!("Unable to parse {}: {}", &content, err);
143 + }
144 + }
145 + }
146 + Err(err) => {
147 + log::error!(
148 + "Unable to read {}: {}",
149 + entry_path.join("metadata.json").display(),
150 + err
151 + );
152 + }
153 + };
154 + }
|
|
the borrowed expression implements the required traits:
src/commands/features/texture_packs.rs#L95
warning: the borrowed expression implements the required traits
--> src/commands/features/texture_packs.rs:95:17
|
95 | / &entry_path
96 | | .join("custom_assets")
97 | | .join(&game_name)
98 | | .join("texture_replacements"),
| |_______________________________________________^
|
= 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
help: change this to
|
95 ~ entry_path
96 + .join("custom_assets")
97 + .join(&game_name)
98 ~ .join("texture_replacements"),
|
|
unneeded `return` statement:
src/commands/features/mods.rs#L901
warning: unneeded `return` statement
--> src/commands/features/mods.rs:901:7
|
901 | / return Err(CommandError::BinaryExecution(
902 | | "Unable to launch REPL".to_owned(),
903 | | ));
| |________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
901 ~ Err(CommandError::BinaryExecution(
902 + "Unable to launch REPL".to_owned(),
903 ~ ))
|
|
unnecessary use of `to_string`:
src/commands/features/mods.rs#L692
warning: unnecessary use of `to_string`
--> src/commands/features/mods.rs:692:31
|
692 | return Ok(to_image_base64(&cover_path.to_string_lossy().to_string()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `cover_path.to_string_lossy().as_ref()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_string`:
src/commands/features/mods.rs#L667
warning: unnecessary use of `to_string`
--> src/commands/features/mods.rs:667:31
|
667 | return Ok(to_image_base64(&cover_path.to_string_lossy().to_string()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `cover_path.to_string_lossy().as_ref()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/commands/features/mods.rs#L136
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/mods.rs:136:49
|
136 | extract_and_delete_tar_ball(&download_path, &parent_path).map_err(|err| {
| ^^^^^^^^^^^^ help: change this to: `parent_path`
|
= 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:
src/commands/features/mods.rs#L136
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/mods.rs:136:33
|
136 | extract_and_delete_tar_ball(&download_path, &parent_path).map_err(|err| {
| ^^^^^^^^^^^^^^ help: change this to: `download_path`
|
= 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:
src/commands/features/mods.rs#L131
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/mods.rs:131:49
|
131 | extract_and_delete_zip_file(&download_path, &parent_path, false).map_err(|err| {
| ^^^^^^^^^^^^ help: change this to: `parent_path`
|
= 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:
src/commands/features/mods.rs#L131
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/mods.rs:131:33
|
131 | extract_and_delete_zip_file(&download_path, &parent_path, false).map_err(|err| {
| ^^^^^^^^^^^^^^ help: change this to: `download_path`
|
= 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:
src/commands/features/mods.rs#L116
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/mods.rs:116:32
|
116 | download_file(&download_url, &download_path)
| ^^^^^^^^^^^^^^ help: change this to: `download_path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded `return` statement:
src/commands/features/mods.rs#L146
warning: unneeded `return` statement
--> src/commands/features/mods.rs:146:3
|
146 | / return Ok(InstallStepOutput {
147 | | success: true,
148 | | msg: None,
149 | | });
| |____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
146 ~ Ok(InstallStepOutput {
147 + success: true,
148 + msg: None,
149 ~ })
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/commands/features/mods.rs#L69
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/mods.rs:69:40
|
69 | extract_tar_ball(&bundle_path_buf, &destination_dir).map_err(|err| {
| ^^^^^^^^^^^^^^^^ help: change this to: `destination_dir`
|
= 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:
src/commands/features/mods.rs#L64
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/features/mods.rs:64:40
|
64 | extract_zip_file(&bundle_path_buf, &destination_dir, false).map_err(|err| {
| ^^^^^^^^^^^^^^^^ help: change this to: `destination_dir`
|
= 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:
src/commands/config.rs#L182
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/config.rs:182:80
|
182 | let tooling_version = Version::parse(version.strip_prefix('v').unwrap_or(&version))
| ^^^^^^^^ help: change this to: `version`
|
= 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:
src/commands/config.rs#L138
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/config.rs:138:83
|
138 | let tooling_version = Version::parse(active_version.strip_prefix('v').unwrap_or(&active_version))
| ^^^^^^^^^^^^^^^ help: change this to: `active_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded `return` statement:
src/commands/config.rs#L105
warning: unneeded `return` statement
--> src/commands/config.rs:105:5
|
105 | return Ok(config_lock.requirements.avx);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
105 - return Ok(config_lock.requirements.avx);
105 + Ok(config_lock.requirements.avx)
|
|
unneeded `return` statement:
src/commands/config.rs#L102
warning: unneeded `return` statement
--> src/commands/config.rs:102:5
|
102 | return Ok(true);
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
102 - return Ok(true);
102 + Ok(true)
|
|
unneeded `return` statement:
src/commands/binaries.rs#L781
warning: unneeded `return` statement
--> src/commands/binaries.rs:781:68
|
781 | log::error!("Error occured when tracking playtime: {}", err);
| ____________________________________________________________________^
782 | | return;
| |____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
781 - log::error!("Error occured when tracking playtime: {}", err);
782 - return;
781 + log::error!("Error occured when tracking playtime: {}", err);
|
|
this boolean expression can be simplified:
src/commands/binaries.rs#L764
warning: this boolean expression can be simplified
--> src/commands/binaries.rs:764:12
|
764 | if !status_code.code().is_some() || status_code.code().unwrap() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `status_code.code().is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
useless use of `format!`:
src/commands/binaries.rs#L715
warning: useless use of `format!`
--> src/commands/binaries.rs:715:52
|
715 | return Err(CommandError::BinaryExecution(format!(
| ____________________________________________________^
716 | | "Failed to resolve custom binary parent directory"
717 | | )));
| |___________^ help: consider using `.to_string()`: `"Failed to resolve custom binary parent directory".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/commands/binaries.rs#L639
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/binaries.rs:639:34
|
639 | let data_folder = get_data_dir(&config_info, &game_name, false)?;
| ^^^^^^^^^^^^ help: change this to: `config_info`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded `return` statement:
src/commands/binaries.rs#L626
warning: unneeded `return` statement
--> src/commands/binaries.rs:626:7
|
626 | / return Err(CommandError::BinaryExecution(
627 | | "Unable to launch REPL".to_owned(),
628 | | ));
| |________^
|
= 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`
|
626 ~ Err(CommandError::BinaryExecution(
627 + "Unable to launch REPL".to_owned(),
628 ~ ))
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/commands/binaries.rs#L68
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/commands/binaries.rs:68:83
|
68 | let tooling_version = Version::parse(active_version.strip_prefix('v').unwrap_or(&active_version))
| ^^^^^^^^^^^^^^^ help: change this to: `active_version`
|
= 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
|
field `tooling_version` is never read:
src/util/game_tests.rs#L18
warning: field `tooling_version` is never read
--> src/util/game_tests.rs:18:3
|
15 | struct CommonConfigData {
| ---------------- field in this struct
...
18 | tooling_version: Version,
| ^^^^^^^^^^^^^^^
|
variant `ModSource` is never constructed:
src/cache.rs#L12
warning: variant `ModSource` is never constructed
--> src/cache.rs:12:3
|
10 | pub enum CacheError {
| ---------- variant in this enum
11 | #[error("{0}")]
12 | ModSource(String),
| ^^^^^^^^^
|
= note: `CacheError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|
variable does not need to be mutable:
src/util/process.rs#L63
warning: variable does not need to be mutable
--> src/util/process.rs:63:7
|
63 | let mut process_status: ExitStatus;
| ----^^^^^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
|
redundant field names in struct initialization:
src/util/game_tests.rs#L46
warning: redundant field names in struct initialization
--> src/util/game_tests.rs:46:5
|
46 | tooling_version: tooling_version,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `tooling_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `tauri::Manager`:
src/commands/util.rs#L8
warning: unused import: `tauri::Manager`
--> src/commands/util.rs:8:5
|
8 | use tauri::Manager;
| ^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
redundant field names in struct initialization:
src/commands/binaries.rs#L74
warning: redundant field names in struct initialization
--> src/commands/binaries.rs:74:5
|
74 | tooling_version: tooling_version,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `tooling_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
Backend Linter
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|