Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mods: support opening a REPL for a mod #582

Merged
merged 1 commit into from
Oct 18, 2024

mods: support opening a REPL for a mod

becb9ec
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

mods: support opening a REPL for a mod #582

mods: support opening a REPL for a mod
becb9ec
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Oct 4, 2024 in 1s

clippy

74 warnings

Details

Results

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

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cd 2024-09-04)

Annotations

Check warning on line 45 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

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

Check warning on line 505 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/macros/select.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.64.0`

warning: current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.64.0`
  --> src/util/process.rs:61:5
   |
61 | /     tokio::select! {
62 | |         Ok(Some(line)) = stdout_reader.next_line() => {
63 | |           let formatted_line = format!("{line}\n");
64 | |           log_file.write_all(formatted_line.as_bytes()).await?;
...  |
90 | |         }
91 | |     }
   | |_____^
   |
   = 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)

Check warning on line 93 in src/util/process.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> src/util/process.rs:93:3
   |
93 |   return Ok(process_status);
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
93 -   return Ok(process_status);
93 +   Ok(process_status)
   |

Check warning on line 17 in src/util/os.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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
   |

Check warning on line 228 in src/util/game_milestones.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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 ~   ]
    |

Check warning on line 82 in src/util/file.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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 ~   )
   |

Check warning on line 52 in src/util/file.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

file opened with `create`, but `truncate` behavior not defined

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

Check warning on line 679 in src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`usize` -> `usize`)

warning: casting to the same type is unnecessary (`usize` -> `usize`)
   --> src/config.rs:679:10
    |
679 |       if (mod_source_index as usize) < sources.len() {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mod_source_index`
    |
    = 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 656 in src/config.rs

See this annotation in the file changed.

@github-actions 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/config.rs:656:58
    |
656 |     let game_config = self.get_supported_game_config_mut(&game_name)?;
    |                                                          ^^^^^^^^^^ help: change this to: `game_name`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 318 in src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.70.0`

warning: current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.70.0`
   --> src/config.rs:318:18
    |
318 |                 .is_some_and(|x| x != "official")
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv

Check warning on line 306 in src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.70.0`

warning: current MSRV (Minimum Supported Rust Version) is `1.61.0` but this item is stable since `1.70.0`
   --> src/config.rs:306:16
    |
306 |               .is_some_and(|x| x != "official")
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = 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

Check warning on line 269 in src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/config.rs:267:9
    |
267 | /         return Err(ConfigError::Configuration(format!(
268 | |           "Supported game missing from games map: {game_name}"
269 | |         )));
    | |___________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
267 ~         Err(ConfigError::Configuration(format!(
268 +           "Supported game missing from games map: {game_name}"
269 ~         )))
    |

Check warning on line 248 in src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/config.rs:246:9
    |
246 | /         return Err(ConfigError::Configuration(format!(
247 | |           "Supported game missing from games map: {game_name}"
248 | |         )));
    | |___________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
246 ~         Err(ConfigError::Configuration(format!(
247 +           "Supported game missing from games map: {game_name}"
248 ~         )))
    |

Check warning on line 460 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:460:14
    |
460 |   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

Check warning on line 232 in src/commands/support.rs

See this annotation in the file changed.

@github-actions 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/commands/support.rs:232:19
    |
232 |                   &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

Check warning on line 220 in src/commands/support.rs

See this annotation in the file changed.

@github-actions 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/commands/support.rs:220:19
    |
220 |                   &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

Check warning on line 197 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:197:58
    |
197 |   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

Check warning on line 166 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:166:44
    |
166 |     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

Check warning on line 154 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:154:11
    |
154 |     .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

Check warning on line 151 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:151:11
    |
151 |     .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

Check warning on line 145 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:145:11
    |
145 |     .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

Check warning on line 135 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:135:46
    |
135 |   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

Check warning on line 125 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:125:27
    |
125 |     &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

Check warning on line 116 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:116:27
    |
116 |     &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

Check warning on line 107 in src/commands/support.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/commands/support.rs:107:27
    |
107 |     &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