This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 6734e96
committed
Auto merge of rust-lang#11505 - Alexendoo:metadata-collector-truncate, r=Manishearth
Truncate files when opening in metadata-collector
Fixes the issue seen here rust-lang/rust-clippy#11483 (comment) and in a couple other PRs
The changelog file was opened without truncating it, so if the new version is shorter than the old one stray contents would remain at the end of the file
The other two files first removed the file so didn't have this problem, but in all cases we now use `fs::write`/`File::create` which is write + create + truncate
changelog: noneFile tree
1 file changed
+10
-27
lines changed- clippy_lints/src/utils/internal_lints
1 file changed
+10
-27
lines changedLines changed: 10 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 232 | + | |
241 | 233 | | |
242 | 234 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 235 | + | |
251 | 236 | | |
252 | 237 | | |
253 | 238 | | |
| |||
261 | 246 | | |
262 | 247 | | |
263 | 248 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
272 | 254 | | |
273 | 255 | | |
274 | | - | |
| 256 | + | |
| 257 | + | |
275 | 258 | | |
276 | 259 | | |
277 | 260 | | |
| |||
0 commit comments